File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public partial class Hashids : IHashids
1616
1717 private const double SEP_DIV = 3.5 ;
1818 private const double GUARD_DIV = 12.0 ;
19- private const int MaxNumberHashLength = 12 ; // Length of long.MaxValue;
19+ private const int MaxNumberHashLength = 19 ; // Length of long.MaxValue;
2020
2121 private readonly char [ ] _alphabet ;
2222 private readonly char [ ] _seps ;
Original file line number Diff line number Diff line change @@ -52,5 +52,18 @@ void issue_15_it_should_return_emtpy_array_when_decoding_characters_missing_in_a
5252 hashids . Decode ( "asdfb" ) . Length . Should ( ) . Be ( 0 ) ;
5353 hashids . DecodeLong ( "asdfgfdgdfgkj" ) . Length . Should ( ) . Be ( 0 ) ;
5454 }
55+
56+ [ Fact ]
57+ void issue_64_it_should_be_possible_to_encode_and_decode_long_max_value ( )
58+ {
59+ var hashids = new Hashids ( "salt" , alphabet : "0123456789ABCDEF" ) ;
60+ var hash = hashids . EncodeLong ( long . MaxValue ) ;
61+
62+ hash . Should ( ) . Be ( "58E9BDD9A7598254DA4E" ) ;
63+
64+ var decoded = hashids . DecodeSingleLong ( hash ) ;
65+
66+ decoded . Should ( ) . Be ( long . MaxValue ) ;
67+ }
5568 }
5669}
You can’t perform that action at this time.
0 commit comments