Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does shortid ensure uniqueness across restarts? #95

Open
Ne0nx3r0 opened this issue Apr 17, 2017 · 2 comments
Open

How does shortid ensure uniqueness across restarts? #95

Ne0nx3r0 opened this issue Apr 17, 2017 · 2 comments

Comments

@Ne0nx3r0
Copy link

I noted this line "Apps can be restarted any number of times without any chance of repeating an id."

I can't seem to sort out how this is accomplished. How does shortid ensure uniqueness with the same settings across restarts?

@irfaan
Copy link

irfaan commented Jun 15, 2017

#58 (comment)

@ai
Copy link
Collaborator

ai commented Jul 8, 2018

There is no insurance in any random ID generator. The same problem in UUID 4.

Just use bigger ID size, to reduce the probability of collision. I recommend to check Nano ID since it has lower collision probability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants