PHPackages                             leg/simhash-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. leg/simhash-php

Abandoned → [tga/simhash-php](/?search=tga%2Fsimhash-php)Library[Utility &amp; Helpers](/categories/utility)

leg/simhash-php
===============

SimHash similarities algorithm implementation for PHP 5.3

2.0(10y ago)1512.0k38[4 issues](https://github.com/tgalopin/SimHashPhp/issues)[2 PRs](https://github.com/tgalopin/SimHashPhp/pulls)MITPHPPHP &gt;=5.3

Since May 30Pushed 5y ago9 watchersCompare

[ Source](https://github.com/tgalopin/SimHashPhp)[ Packagist](https://packagist.org/packages/leg/simhash-php)[ Docs](http://titouangalopin.com)[ RSS](/packages/leg-simhash-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (6)Used By (0)

SimHashPHP
==========

[](#simhashphp)

> This is the second version of SimHashPHP. If you are using the version 1 and don't want to update your code, please refer to the `1.0-security` branch (). The 1.0 branch will be maintained until the release of a v3 but only the v2 will have lastest features.

What is SimHashPHP ?
--------------------

[](#what-is-simhashphp-)

SimHashPHP is a PHP library that port the SimHash algorithm in PHP. This algorithm, created by Moses Charikar, provides an efficient way to compute a similarity index between two texts. It is used by Google internally to detect dupplicate content.

See ["SimHash or the way to compare quickly two datasets"](https://titouangalopin.com/2014/06/29/simhash/) for more informations.

[![Build Status](https://camo.githubusercontent.com/216b20c5d56aef91d8fc3d2db5711de5382d00fe2f62dbe331b94ebd6b7f5a64/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7467616c6f70696e2f53696d486173685068702e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/tgalopin/SimHashPhp)

How to use it ?
---------------

[](#how-to-use-it-)

Install it with [Composer](https://getcomposer.org):

```
composer require tga/simhash-php
```

Once installed, include `vendor/autoload.php` to load the library.

The concept of SimHash is described in [this article](https://titouangalopin.com/2014/06/29/simhash/). Here are few examples:

```
