-
Notifications
You must be signed in to change notification settings - Fork 172
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
alphabet must contain at least 4 unique characters #20
Comments
I'll have a look and see if I can reproduce! |
what is your variable "minHashLength"? |
Ok, I've reproduced the issue, the problem here I guess is that the APi is a bit unclear... The Hashids class relies on having an alphabet and separators. After removing separator characters it should at least be 4 characters left.. But the code checks that a bit weird. I'll make a new version and close this ticket when fixed! |
Came across this issue as well. So should it be possible to use Hashids with an alphabet of 10 digits? |
I've seen that they've changed a bit in the javascript library from how it was in the original port. You are able to change the alphabet, but not the seps anymore. @ivanakimov just want to check with you what the intent is, should you be able to construct a hashids object like above. I don't want to loose compatibility with the other ports. |
The latest version of Hashids requires a minimum of 16 characters. The reason for that is the length of separators, which is 14. That way if you give the worst possible alphabet, like I'm not sure we were ever providing access to To make the above code work (with just numbers as alphabet), @bichtv you'd have to clone the repo and get rid of that restriction manually. |
@ivanakimov maybe you're right. Either the capability of sending in Maybe I should remove that capability then! |
@ullmark yeah, well if somebody modifies it, then ids won't match across other implementations. It's actually a todo for future releases, but currently not supported across libs. |
Came here to open the same bug. 16 Chars is fine but please fix the error message
|
I have issue:
var hashids = new Hashids("This is my salt", minHashLength, "0123456789");
the way resolve exception ?
Thank for support
The text was updated successfully, but these errors were encountered: