The implementation of the hashids.to_alphabet function leads to different encodings for the value 0 compared to implementations in other languages. Specifically, if current_number begins as 0 the function is essentially skipped.
|
while current_number > 0 loop |
Python:
https://github.com/davidaurelio/hashids-python/blob/09f879a1967836f1e399c12b745c24291e3e73ad/hashids.py#L43
Ruby:
https://github.com/peterhellberg/hashids.rb/blob/b729fe514e492e18d9f69473b53eb59a3b5aee4b/lib/hashids.rb#L163
The implementation of the
hashids.to_alphabetfunction leads to different encodings for the value 0 compared to implementations in other languages. Specifically, ifcurrent_numberbegins as 0 the function is essentially skipped.hashids.sql/hashids.sql
Line 13 in 3464d83
Python:
https://github.com/davidaurelio/hashids-python/blob/09f879a1967836f1e399c12b745c24291e3e73ad/hashids.py#L43
Ruby:
https://github.com/peterhellberg/hashids.rb/blob/b729fe514e492e18d9f69473b53eb59a3b5aee4b/lib/hashids.rb#L163