A PHP extension to add support for the xxHash fast hashing algorithm.
xxHash is an Extremely fast Hash algorithm, running at RAM speed limits. It successfully completes the SMHasher test suite which evaluates collision, dispersion and randomness qualities of hash functions.
Please note at the moment the master branch should be used for PHP 5.x and develop branch should be used for PHP 7.x
###Unix:
phpize
./configure --enable-xxhash
make
sudo make install
###Windows: Follow this guide until Compile step 4. Afterwards, run:
configure --enable-xxhash=shared
nmake
The library can be found in C:\php-sdk\phpdev\vc14\x64\php-VERSION-src\x64\Release_TS\php_xxhash.dll
Don't forget to load the extension in via php.ini or the like.
Upon installation and enabling the extension within php.ini the following two new functions will be available to you:
string xxhash32(string $data, int $seed);
string xxhash64(string $data, int $seed);
In both cases a string will be returned, representing the digest (hash) of the $data input.
- Original implementation of php-xxhash by Stuart Herbert.
- xxHash by Yann Collet.
BSD 2-clause license.