arcticicestudio / icecore-hashids

A lightweight generator for short, unique, non-sequential and decodable Hashids from non-negative numbers.
https://arcticicestudio.github.io/icecore-hashids
MIT License
12 stars 3 forks source link

bug can't use long.max #33

Open stjava opened 3 years ago

stjava commented 3 years ago

can not use Long.MAX_VALUE

Hashids hashids = new Hashids(); String encode = hashids.encode(Long.MAX_VALUE); System.out.println(encode);

arcticicestudio commented 3 years ago

Hi @stjava :wave:, thanks for your contribution :+1:

Have you made sure to enable the additional feature that disable the maximum number size limit? Otherwise this library ensures the interoperability with the algorithm reference implementation which won't allow the usage of Java's Long.MAX_VALUE because of the way JavaScript handles number values.