Fix auto-generated IDs not always being unique.
Fix auto-generated IDs not always being unique.

Due to timer coalescing and other optimizations in OSes and JavaScript engines, Date.now() can return the same value over several milliseconds. This means that if you call PUT() more than 100 times a second or so, you're likely to generate the same ID and accidentally overwrite recently-inserted data.

This change fixes the issue. Overwriting is still possible, but you'd have to close the DB, change the system's clock to an earlier time, then reopen the DB and start inserting data.

fergiemcdowall/search-index