Nichlas Severinsen f284892e53 Updated CHANGELOG.md | 4 years ago | |
---|---|---|
include | 4 years ago | |
src | 4 years ago | |
tests | 4 years ago | |
.editorconfig | 4 years ago | |
.gitignore | 4 years ago | |
.php_cs | 4 years ago | |
CHANGELOG.md | 4 years ago | |
COPYING | 4 years ago | |
LICENSE.txt | 4 years ago | |
README.md | 4 years ago | |
composer.json | 4 years ago | |
phpunit.xml | 4 years ago |
This is an FFI binding of the libxxHash
library from xxHash for PHP.
You're here because:
xxhash
package on your system to get libxxHash.If so, you're in the right place.
You will obviously need the xxHash
package.
In addition you will need libffi
, and enable FFI for PHP (You will therefore need PHP version 7.4 or above).
Here are some common ways to install:
sudo pacman -S xxhash libffi
sudo apt install xxhash libffi
sudo dnf install xxhash libffi
sudo zypper install xxhash libffi
PHP has to be compiled with the --with-ffi
option, most distributions will have done this.
Locate the relevant php.ini
file on your system and make sure this line is there, uncommented:
extension=ffi
Alright, alright. I know what you want, and I got what you need. You've got files, we got hashes:
<?php
use Necklace\XxHash\XxHash64;
$xxh = XxHash64;
echo $xxh->hashFile('filename');
2e790d069a07b05183ff80eedd51d542
Look in tests/
for more examples.
This repository and all its files is under the same license as the xxHash project; the BSD 2-Clause License.
See COPYING or LICENSE.txt.
Clone and run composer install
.
Run all tests with php vendor/bin/phpunit
from the top directory.