yomorun / hashids-java

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

hash collision #68

Closed arianne-detorres closed 4 years ago

arianne-detorres commented 4 years ago

Hi, I'm using hashids to encode internal ids in our system, however I noticed a few collisions:

Hashids hashids = new Hashids( salt, 8, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" );
System.out.println(hashids.encode( 5551008 ));
System.out.println(hashids.encode( 5552196 ));

Returns:

mnbgLzGm
mnbgLZGm

Any ideas as to how this can happen? From the documentation, it seems this should be impossible. We're using the latest version (1.0.3)

0x3333 commented 4 years ago

Same as issue #62 . Letter Z in upper, and lower case. Hashids are case sensitive.