Skip to content
PHP7 murmurhash3 extension
Branch: master
Clone or download
Pull request Compare This branch is 8 commits ahead of j42:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
GPL-LICENSE
MIT-LICENSE
MurmurHash3.cpp
MurmurHash3.h
README.md
config.m4
php_murmurhash3.cpp
php_murmurhash3.h

README.md

PHP7 MurmurHash3

MurmurHash is an algorithm desiged by Austin Appleby.

Changes

  1. Add PHP 7 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 7.1: /etc/php/7.1/mods-available/):

extension=murmurhash3.so

Finally enable it in PHP:

sudo phpenmod murmurhash3

Usage

// Example
echo murmurhash3('anystring');      // default seed usage
echo murmurhash3('anystring', 123); // specific seed usage

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

// Example from @maksimf
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦');
echo murmurhash3('豥붢㦖徱阵儹㜀耄巅簏罚撦', 1096928849);
You can’t perform that action at this time.