yomorun / hashids-java

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

Long number fix #4

Closed denisgeo closed 10 years ago

denisgeo commented 10 years ago

When you call encrypt method for Long values (greater than Integer.MAX_VALUE for example: 1234567890123L) method throwed Exception. Reason of this was that in hash & unhash methods calculations was performed in int variable.

I've doubt that maybe you do it intentionally but I had real world case when i needed long enough values and had to edit your source code.

Also, In JavaScript project (http://www.hashids.org/javascript/) it works for big numbers why shouldn't it work in Java ...

fanweixiao commented 10 years ago

Thanks for your PR, I've merged :+1: