yomorun / hashids-java

Hashids algorithm v1.0.0 implementation in Java
http://hashids.org
MIT License
1.02k stars 156 forks source link

Question about the output #42

Closed ulisses79 closed 7 years ago

ulisses79 commented 7 years ago

Sorry for maybe naive question but.... Assuming that my alphabet is complete i.e. contains all characters and digits. I wonder if there is a possibility that encode method would return a hash which contains only digits? Other words is there a string which can be encoded and the result contains only digits? Is it guaranteed that at leat one letter is present in the output?

0x3333 commented 7 years ago

No, alphabet must contain at least 16 unique characters, including numbers. This is by design. There is no guarantee that the output will contains a group of the alphabet characters.

ulisses79 commented 7 years ago

Thank you for the answer.