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 the master branch should be used only for PHP 7.x
phpize
./configure --enable-xxhash
make
sudo make install
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:
int xxhash32(string $data);
int xxhash64(string $data);
In both cases a int will be returned, representing the digest (hash) of the $data input. Note that xxhash64 value is truncated to 32bit value in 32bit system.
- Original implementation of php-xxhash by Craig R.
- xxHash by Yann Collet.
BSD 2-clause license.