Skip to content

A PHP library for computing and comparing Nilsimsa hashes

License

Notifications You must be signed in to change notification settings

opctim/php-nilsimsa

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

php-nilsimsa

PHP library to calculate and compare Nilsimsa digests.

The Nilsimsa hash is a locality senstive hash function. Generally similar documents will have similar Nilsimsa digests. The Hamming distance between the digests can be used to approximate the similarity between documents. For further information consult http://en.wikipedia.org/wiki/Nilsimsa_Hash and the references (particularly Damiani et al.)


Implementation details:

The Nilsimsa class takes in a data parameter which is the string of the document to digest Calling the methods hexdigest() and digest() give the nilsimsa digests in hex or array format. The helper function compare_digests takes in two digests and computes the Nilsimsa score. You can also use compare_files() and compare_strings() to compare files and strings directly.

This code is a port of py-nilsimsa located at https://code.google.com/p/py-nilsimsa

This repository has been forked from beager/php-nilsimsa. It has been cleaned up and restructured so it can be used as a composer package.

@beager released this under the MIT license, (c) 2015 Bill Eager

About

A PHP library for computing and comparing Nilsimsa hashes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%