-
Notifications
You must be signed in to change notification settings - Fork 6
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not generate unique ID #11
Comments
I think there are two things this library does that cause this. There may be more.
Also, for the purpose of the library, the primary key(s) would the result of decoding the ID you get from the user anyway. So the URL would not be |
@miquelfire thanks for your time to post in this issue! I think you have not read my question. I did not ask the reason(s) for getting duplicates, I wanted to know if there is any plan to fix this. @vinkla , |
Sounds like you had the same issue as here |
馃毀 Because of the algorithm's design, multiple IDs can decode back into the same sequence of numbers. If it's important to your design that IDs are canonical, you have to manually re-encode decoded numbers and check that the generated ID matches.
The above text is mentioned in the ReadMe file. Can you please elaborate on it a little more?
I was planning to use it with the primary key, but if multiple encoded IDs are decoded as the same key, then this might not be useful. Do you have plans to fix this issue soon?
In the previous version of this library (https://github.com/vinkla/hashids) did not mention this issue, is this new to
sqids
?The text was updated successfully, but these errors were encountered: