Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minus as prefix for xxhash64_hex() return value, sometimes <16 characters #4

Closed
ghost opened this issue Apr 24, 2017 · 0 comments
Closed

Comments

@ghost
Copy link

ghost commented Apr 24, 2017

Hi,

most of the time xxhash64_hex() returns 16xcharacters, but sometimes I'm getting minus sign as a 17th character and sometimes less then 16 characters:

perl -lE 'use Digest::xxHash qw(xxhash64_hex); say xxhash64_hex("b"x100000,89027)'
26be6c330380e6b8
# ^^^ 16 chars
perl -lE 'use Digest::xxHash qw(xxhash64_hex); say xxhash64_hex("b"x100000,890272)'
-2070116b240df563
# ^^^ minus char as prefix
$ perl -lE 'use Digest::xxHash qw(xxhash64_hex); $h = xxhash64_hex("b"x100000,89); say $h; say length($h)'
1aae2582443bbf0
# ^^^ 15 chars
$ whichpm Digest::xxHash
/opt/perl-5.22.0-live/lib/site_perl/5.22.0/x86_64-linux/Digest/xxHash.pm 2.03

xxhash64_hex() should be using uint64_to_hex() instead of int64_to_hex() to prevent the minus character.

Would be good if the variable hex string length is documented or that the hex string is zero padded to 16 characters as shaX_hex() friends do.

Best regards
Jozef

@sanko sanko closed this as completed in ac70a65 Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants