Skip to content

A C++ fork/rewrite of the smhasher project to bring Murmurhash v.3 to the Linux shell and to the PHP scripting language.

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
GPL-LICENSE
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

Wattpad/MurmurHash3PHP

 
 

Repository files navigation

MurmurHash3PHP

A C++ fork/rewrite of the smhasher project to bring Murmurhash3 to the Linux shell and to the PHP scripting language.

Installation

git clone https://github.com/sgtsquiggs/MurmurHash3PHP.git
cd MurmurHash3PHP
phpize
./configure --enable-murmurhash3
make install

Usage

MurmurHash is not cryptographically secure, so I am just using rand()

int seed = rand();
// 681830476 for this example

murmurhash3_128(key, seed)

Generates a 128 bit hash.

echo murmurhash3_128('this is the key for my 128 bit hash', seed);
// 476d1835de8c85f3f6686e7f68ac515a

murmurhash3_32(key, seed)

Generates a 32 bit hash.

echo murmurhash3_32('this is the key for my 32 bit hash', seed);
// 9853e119

murmurhash3(key, seed)

Alias of murmurhash3_128.

About

A C++ fork/rewrite of the smhasher project to bring Murmurhash v.3 to the Linux shell and to the PHP scripting language.

Resources

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
GPL-LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 73.5%
  • C 19.9%
  • Shell 4.0%
  • M4 2.6%