Closed clementbirkle closed 6 years ago
There's no ensured uniqueness. Time doesn't help about that, since you can't assume that IDs are generated in different times. The real question is the probability of clashing IDs. As already mentioned in #7, you can decrease the chance of clashes by increasing the length of your Shortid.
Thank you for your fast response. I thought that the time help to reduce the possibility of collision but apparently not :/
Hello, apparently this library is a port of https://github.com/dylang/shortid
The shortid original library create ids with the time to ensure unique ids. I did't see anything similar in this library.
See more here: https://github.com/dylang/shortid/blob/master/lib/build.js
How this library can ensure a unique id ?