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

Same hash different integers #96

Open
johnseabi opened this issue Apr 8, 2024 · 3 comments
Open

Same hash different integers #96

johnseabi opened this issue Apr 8, 2024 · 3 comments

Comments

@johnseabi
Copy link

Hi guys

I am using this package and I really love it.
However, I have run into a duplicate issue where these two Ids are hashed to the same 17 charecter string:
518441536
520571136

the resulting hash : gOnbdg2ENEBPRP5mY
that is of coursing using the same Salt.

I see there was the same issue opened last year Nov and the person said they were mistaken but I am pretty sure there is an issue here.

I am actively using this package and just last week i started seeing this problem.

@ullmark is this something that is being worked on to find the root cause?

@ullmark
Copy link
Owner

ullmark commented Apr 8, 2024

@johnseabi Hi, in general there is very little being worked on with this library since the original algoritm author decided that everything should be re-done. 😏

Maybe you could create a PR with a test failing with your scenario including the has you used?

@johnseabi
Copy link
Author

johnseabi commented Apr 9, 2024

Thanks.

Do you know do you know if there is a way for me to check the hashspace of the algorithm?
I am using this in a production enviroment and I found a way around the above issue, only that dependends on me having an idea about the hashspace of the algorithm

@ullmark
Copy link
Owner

ullmark commented Apr 25, 2024

Not entirely sure what you mean here... I initially ported the much of the code from the ruby version of the library (since the author is an acquaintance of mine). Since then we've made a lot of changes ofc.

The algoritm itself comes from the javascript library and the original author @4kimov.
If you do end up creating a test proving this issue and/or fixing it, you are welcome to supply a PR!

Without that test, it's going to be hard to find the issue you're having.
You could also try to change to https://sqids.org/dotnet but I do believe that hashes will be different so you'd need to to a migration.

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

2 participants