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
{{ message }}
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
Well it's a pretty self explainetory issue, when the hash has leading zeros, it'll be omitted.
And that's something you'll never see in the output hash of any other algorithm, like sha256.
Just to make sure, I did check the python implementation of xxh64 and it also keeps the leading zeroes.
For example for XXH64......toString(16) this is the fix I used: if( hash.length < 16 ) hash = '0'.repeat( 16 - hash.length ) + hash
Hope it helps, and thanks :)
The text was updated successfully, but these errors were encountered:
Hexadecimal numbers below 16 can be represented by a single character, potentially leading to uneven string lengths. Maybe we could add a function to replace toString, which internally runs toString and then applies either of the following methods:
It checks whether the resulting hexadecimal string's length is odd, which means it would only have one character if the most significant digit of the original number was less than 16.
Overwriting toString may cause issues for people not aware of the change. This approach, while functional, may not be the optimal solution, but it's a consideration worth exploring
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Well it's a pretty self explainetory issue, when the hash has leading zeros, it'll be omitted.
And that's something you'll never see in the output hash of any other algorithm, like sha256.
Just to make sure, I did check the python implementation of xxh64 and it also keeps the leading zeroes.
For example for
XXH64......toString(16)
this is the fix I used:if( hash.length < 16 ) hash = '0'.repeat( 16 - hash.length ) + hash
Hope it helps, and thanks :)
The text was updated successfully, but these errors were encountered: