You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IF unsigned 64-bit integer was support, it would accept: 2^64 or 0 - 18,446,744,073,709,551,616 (1.8x10^19)
IF signed 64-bit integer was support from zero up, it would accept: 2^63 or 0 - 9,223,372,036,854,775,807 (9.2x10^18)
You currently support 53 bit long integers - I can only assume that is a bug? Java's primitives are always signed, so you have about 2^63 values in the plus and minus range. The most logical range would be 2^63 if you only want to support from 0 up and not make the caller convert to unsigned longs?
The text was updated successfully, but these errors were encountered:
Ah I see, thanks. Maybe adapt the readme, because 'decodable hashes from unsigned (long) integers' is very misleading as it does not mean unsigned in the primitive type sense, but just that negative numbers are not allowed, it actually uses signed longs.
The doc says:
but then it says
And the implementation caps the max number to 2^53 (0-9,007,199,254,740,992)
https://github.com/10cella/hashids-java/blob/162a263c8007652472bf1821a26d33190730f8a5/src/main/java/org/hashids/Hashids.java#L24
0 - 18,446,744,073,709,551,616
(1.8x10^19)0 - 9,223,372,036,854,775,807
(9.2x10^18)You currently support 53 bit long integers - I can only assume that is a bug? Java's primitives are always signed, so you have about 2^63 values in the plus and minus range. The most logical range would be 2^63 if you only want to support from 0 up and not make the caller convert to unsigned longs?
The text was updated successfully, but these errors were encountered: