/php-xxhash

PHP extension for the xxhash library

Primary LanguageC

PHP-xxHash

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.

PHP5 Compatability

Please note the master branch should be used only for PHP 7.x

Installation Instructions

   phpize
   ./configure --enable-xxhash
   make
   sudo make install

Don't forget to load the extension in via php.ini or the like.

Usage Instructions

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.

Credits

Licence

BSD 2-clause license.