PhpDev.App
lastguest/murmurhash-php

lastguest/murmurhash-php

Stars: 122

Forks: 37

Pull Requests: 4

Issues: 11

Watchers: 9

Last Updated: 2023-05-24 19:57:34

PHP userland implementation of MurmurHash3

License: MIT License

Languages: PHP

MurmurHash3

Latest Stable Version Total Downloads Latest Unstable Version License

PHP Implementation of MurmurHash3

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 lastguest/murmurhash

Usage

You can retrieve an hash via hash3 static method of class Murmur

<?php
use lastguest\Murmur;

echo Murmur::hash3("Hello World");
// cnd0ue

You can pass a precise seed positive integer as second parameter

<?php
use lastguest\Murmur;

echo Murmur::hash3("Hello World", 1234567);
// qtq2u

If you need the integer hash, use the hash3_int method

<?php
use lastguest\Murmur;

echo Murmur::hash3_int("Hello World");
// 427197390