-
Notifications
You must be signed in to change notification settings - Fork 7.9k
hash: Implement xxHash #6524
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
hash: Implement xxHash #6524
Conversation
The implementation bundles the xxHash v0.8.0 release and includes all the variants - xxh32, 32-bit wide - xxh64, 64-bit wide - xxh3, 64-bit wide - xxh128, 128-bit wide An initial hash state can be passed through the options arrray. An additional functionality not targeted in this implementation is the secret support in xxh3 and xxh128. That can be added at a later point. The serialization for xxh3 and xxh128 should not be implemented, as the state would contain the secret. Despite the xxHash is a non crypto algorithm, the secret would be serialized as plain text which would be insecure. Signed-off-by: Anatol Belski <ab@php.net>
Would someone have time to take a look? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for the check! I'll plan to finish this up soon. |
I don't get your reasoning here. In what way is xxHash different from all other hash algorithms? In the paragraph before you also say that secret support is not targeted. |
Hi, thanks for checking. To compare is here XXH3_state_s vs. for example XXH64_state_s. Both Another part here - as one can see, the secret in Thanks |
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Includes unit tests. Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com> Closes GH-1451.
> **MurmurHash3** > > Added support for MurmurHash3 with streaming support. The following variants are implemented: > * murmur3a, 32-bit hash > * murmur3c, 128-bit hash for x86 > * murmur3f, 128-bit hash for x64 > > **xxHash** > > Added support for xxHash. The following variants are implemented: > * xxh32, 32-bit hash > * xxh64, 64-bit hash > * xxh3, 64-bit hash > * xxh128, 128-bit hash Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.murmurhash3 * php/php-src#6059 * php/php-src@72e91e9 * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.hash.xxhash * php/php-src#6524 * php/php-src@23590f7 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com> Closes phpGH-1451.
The implementation bundles the xxHash v0.8.0 release and includes all the variants
An initial hash state can be passed through the options arrray. An additional
functionality not targeted in this implementation is the secret support in xxh3
and xxh128. That can be added at a later point.
The serialization for xxh3 and xxh128 should not be implemented, as the
state would contain the secret. Despite the xxHash is a non crypto
algorithm, the secret would be serialized as plain text which would be
insecure.
Signed-off-by: Anatol Belski ab@php.net