Skip to content

PHP extension for the xxhash library

Notifications You must be signed in to change notification settings

esterTion/php-xxhash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

PHP7 Compatability

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

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:

string xxhash64(string $data[, int $seed[, bool $return_as_decimal]]);
string xxhash32(string $data[, int $seed[, bool $return_as_decimal]]);

In both cases a string will be returned, representing the digest (hash) of the $data input.
When $return_as_decimal is true, return decimal string instead of hexadecimal.

Credits

  • Original implementation of php-xxhash by Stuart Herbert.
  • xxHash by Yann Collet.

Licence

BSD 2-clause license.

About

PHP extension for the xxhash library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 97.7%
  • M4 1.9%
  • JavaScript 0.4%