Skip to content

arkhamvm/php7-murmurhash3

 
 

Repository files navigation

PHP7 MurmurHash3

MurmurHash is an algorithm desiged by Austin Appleby.

Changes

  1. Add PHP 7.x/8.0 support.
  2. Seed parameter can be omitted.

Install

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

Create murmurhash3.ini in lib dir (for example php 8.0: /etc/php/8.0/mods-available/):

extension=murmurhash3.so

Finally enable it in PHP:

sudo phpenmod murmurhash3

Usage

<?php
// Example
echo murmurhash3('anystring') . PHP_EOL;      // default seed usage
echo murmurhash3('anystring', 123) . PHP_EOL; // specific seed usage

// Some locale strings
echo murmurhash3('№АаЯя') . PHP_EOL;

// Example from @maksimf
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦') . PHP_EOL;
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦', 1096928849) . PHP_EOL;

echo 'all ok' . PHP_EOL;

About

PHP7 murmurhash3 extension

Resources

License

GPL-3.0, MIT licenses found

Licenses found

GPL-3.0
GPL-LICENSE
MIT
MIT-LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 72.4%
  • C 24.2%
  • M4 2.8%
  • PHP 0.6%