Uh oh!
There was an error while loading. Please reload this page.
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>
weltling
commented
Dec 20, 2020
weltling
commented
Jan 5, 2021
Would someone have time to take a look? Thanks. |
weltling
commented
Jan 8, 2021
Thanks for the check! I'll plan to finish this up soon. |
nikic
commented
Jan 11, 2021
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. |
weltling
commented
Jan 11, 2021
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> ClosesGH-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> ClosesphpGH-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