-
Notifications
You must be signed in to change notification settings - Fork 103
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 to use numbers only in alphabet #31
Comments
The limit is most likely there for compatibility reasons, since this is a Python port of the JavaScript hashids implementation. The same limit is present in the JS source code. On that note, I recommend this issue be closed. |
The lua port support number only alphabet, could you add an option to support this feature? |
Like I said, I think the limit is there for compatibility reasons with the JS implementation, and the maintainers/owner of the lua port probably thought that it is ok to add support for smaller alphabets. Whether it should be added here is up to the maintainers/owner of this port. I am neither, so even if I submit a PR, it is still their decision. They have not even responded to this issue, and you created this issue almost 3 months ago. They have not even responded to my offer to help at #32. In any case, my use case does not need a smaller alphabet, so all things considered, I cannot allocate time to do this. |
Correct me if I am wrong here, but the request to use base 10 encoding for an integer which is already base 10... would just be substituting or ciphering. see this link Base What? |
Apologies for the long silence here. Yes, the limitation exists for compatibility with JS. Thanks! |
I'd also prefer having |
Would I be right in saying that this would simply be a case of removing the raise exception on line 194? Or is there more to it than that? |
@bodgerbarnett are you referring to [line 194 in the python implementation(https://github.com/davidaurelio/hashids-python/blob/master/hashids.py#L194)? Or do you mean line 185? Honestly, in the end somebody would have to try it out. I can try working through the code at some point to see what possible detrimental effects of a small alphabet would be. In any case, it is possible to use hex encoding (`alphabet='0123456789abcdef') and change the value to/from base 10 after encoding/before decoding. |
I use alphabet="0123456789cfhistu" to filter letter. |
its only support int value |
I use
hashids = Hashids(salt="hello", min_length=6, alphabet='0123456789')
But "Alphabet must contain at least 16 unique characters." execption raised.
Why Alphabet must contain at least 16?
The text was updated successfully, but these errors were encountered: