Generate random time-based IDs like Firebase
npm install firebase-auto-idsGenerate random time-based, collision-proof IDs a la Firebase.push. Designed for testing and education (readability), not performance.
``sh`
$ npm install firebase-auto-ids
##### generate(now) -> String
firebase-auto-ids exports a function. Pass in now, the current timestamp (e.g. Date.now()). generate returns an ID string. Like Firebase.push, IDs hold the following properties:
* id1 < id2 where id1 was created at an earlier time (now) than id2id1
* < id2 where id1 and id2 were created at the same now but generateAutoId was executed for id1 before id2id1
* !== id2 where id1 and id2 were created at the same now in different clients
##### new generate.Generator() -> generator
Creates a new generator instance. Individual instances do not share state. This means that IDs created at the same time in a given runtime will no longer be determined by call order.
##### generator.generate(now) -> String
Same as generate(now)`