PHP Classes

PHP Murmurhash: Generate hash values of a string using Murmurhash

Recommend this page to a friend!
  Info   View files Documentation   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2022-08-03 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 43 This week: 24All time: 10,426 This week: 7Up
Version License PHP version Categories
murmurhash-php 1.0MIT/X Consortium ...5Algorithms, PHP 5
Description Author

This package can generate hash values of a string using Murmurhash.

It takes a given string and a seed integer value as parameters.

The package computes the hash value of the string using the Murmurhash algorithm.

Innovation Award
PHP Programming Innovation award nominee
August 2022
Nominee
Vote
Hashing is an operation that computes a value from a string of data.

Hashing operations help check the integrity of data that may be transmitted between a source computer and a destination computer to detect data transmission failures caused by external interferences.

In environments in which security is an important aspect, developers should use cryptographic hashing algorithms to detect malicious alteration of data by people with bad intentions.

In environments where security is not essential due to the low risk of alteration of data by bad-intentioned people, developers can use non-cryptographic algorithms.

Such algorithms do not require so much CPU processing power and can run faster.

Murmurhash is a non-cryptographic algorithm.

This package provides a pure PHP implementation of the Murmurhash algorithm. Therefore it does not require that particular cryptography PHP extensions are available to use this class.

Manuel Lemos
Picture of Stefano Azzolini
  Performance   Level  
Name: Stefano Azzolini <contact>
Classes: 3 packages by
Country: Italy Italy
Age: 41
All time rank: 3902159 in Italy Italy
Week rank: 6 Up1 in Italy Italy Up
Innovation award
Innovation award
Nominee: 2x

Details

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
  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (2 files, 1 directory)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagelastguest (1 file)

  Files folder image Files  /  src  /  lastguest  
File Role Description
  Plain text file Murmur.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagecases (1 file)
  Accessible without login Plain text file phpstan.neon Data Auxiliary data
  Accessible without login Plain text file phpunit.xml Data Auxiliary data

  Files folder image Files  /  tests  /  cases  
File Role Description
  Accessible without login Plain text file MurmurTest.php Test Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:43
This week:24
All time:10,426
This week:7Up
For more information send a message to info at phpclasses dot org.