PHPackages                             opctim/php-nilsimsa - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. opctim/php-nilsimsa

ActiveLibrary

opctim/php-nilsimsa
===================

A PHP implementation of the Nilsimsa hash.

1.0.4(7y ago)316.4k↓46.4%MITPHPPHP &gt;=5.6.0

Since May 6Pushed 2y agoCompare

[ Source](https://github.com/opctim/php-nilsimsa)[ Packagist](https://packagist.org/packages/opctim/php-nilsimsa)[ RSS](/packages/opctim-php-nilsimsa/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/17a15a26e8b348340f059f3aec78cfe368c656a68b4a4a270d68bdf831c3ef0a/687474703a2f2f706f7365722e707567782e6f72672f6f706374696d2f7068702d6e696c73696d73612f76)](https://packagist.org/packages/opctim/php-nilsimsa) [![Total Downloads](https://camo.githubusercontent.com/0046be727bc0f3155fcda0d8e7939d5e3723b3ea178bbbb4a547f76f6742a36f/687474703a2f2f706f7365722e707567782e6f72672f6f706374696d2f7068702d6e696c73696d73612f646f776e6c6f616473)](https://packagist.org/packages/opctim/php-nilsimsa) [![Latest Unstable Version](https://camo.githubusercontent.com/b5c27ab5de58108662067e9483183d700809aa243e974685de90008273cf1fbe/687474703a2f2f706f7365722e707567782e6f72672f6f706374696d2f7068702d6e696c73696d73612f762f756e737461626c65)](https://packagist.org/packages/opctim/php-nilsimsa) [![License](https://camo.githubusercontent.com/93ffc48bb0a1c715bc184810c709fd0aa0039ae193581d05d72050c5bbfbc7e9/687474703a2f2f706f7365722e707567782e6f72672f6f706374696d2f7068702d6e696c73696d73612f6c6963656e7365)](https://packagist.org/packages/opctim/php-nilsimsa) [![PHP Version Require](https://camo.githubusercontent.com/6eca595a59cc58f74468b6c09f0feb5fc3c9ced257a16f91c14e3931bf5ed2fe/687474703a2f2f706f7365722e707567782e6f72672f6f706374696d2f7068702d6e696c73696d73612f726571756972652f706870)](https://packagist.org/packages/opctim/php-nilsimsa)

php-nilsimsa
============

[](#php-nilsimsa)

### PHP library to calculate and compare Nilsimsa digests.

[](#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](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

**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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

2567d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8baeff15fda4dfffadf3162c3208390ddcf00bd5161143d2d1a235943c93d63a?d=identicon)[opctim](/maintainers/opctim)

---

Top Contributors

[![beager](https://avatars.githubusercontent.com/u/1027710?v=4)](https://github.com/beager "beager (1 commits)")[![billeager](https://avatars.githubusercontent.com/u/3064313?v=4)](https://github.com/billeager "billeager (1 commits)")[![opctim](https://avatars.githubusercontent.com/u/29566085?v=4)](https://github.com/opctim "opctim (1 commits)")

### Embed Badge

![Health badge](/badges/opctim-php-nilsimsa/health.svg)

```
[![Health](https://phpackages.com/badges/opctim-php-nilsimsa/health.svg)](https://phpackages.com/packages/opctim-php-nilsimsa)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
