hemric / murmurhash
MurmurHash3 Hash (php8)
Installs: 205
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 39
pkg:composer/hemric/murmurhash
Requires
- php: ^8
Requires (Dev)
- phpstan/phpstan: ^0.12.68
- phpunit/phpunit: ^9.5
README
PHP(8) Implementation of MurmurHash3 (forked from: https://github.com/lastguest/murmurhash-php)
More information about these algorithms can be found at:
Porting of the MurmurHash3 JavaScript version created by Gary Court (https://github.com/garycourt/murmurhash-js)
Installation
Use composer :
composer require hemric/murmurhash
Usage
You can retrieve an hash via hash3 static method of class Murmur
<?php use hemric\Murmur; echo Murmur::hash3("Hello World"); // cnd0ue
You can pass a precise seed positive integer as second parameter
<?php use hemric\Murmur; echo Murmur::hash3("Hello World", 1234567); // qtq2u
If you need the integer hash, use the hash3_int method
<?php use hemric\Murmur; echo Murmur::hash3_int("Hello World"); // 427197390