PHPackages                             znk3r/hash-equals - 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. [Security](/categories/security)
4. /
5. znk3r/hash-equals

ActiveLibrary[Security](/categories/security)

znk3r/hash-equals
=================

A compatibility library for hash\_equals() to avoid timing attacks

169[1 issues](https://github.com/znk3r/hash_equals/issues)PHP

Since Mar 7Pushed 11y ago1 watchersCompare

[ Source](https://github.com/znk3r/hash_equals)[ Packagist](https://packagist.org/packages/znk3r/hash-equals)[ RSS](/packages/znk3r-hash-equals/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

hash\_equals
============

[](#hash_equals)

PHP implementation of hash\_equals() for versions previous to 5.6

This function has been created to compare hash strings, in a way that prevents timing attacks. Some libraries have similar implementations, but as part of bigger packages.

Installation
------------

[](#installation)

Via [composer.json](http://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup)

```
"require": {
    "znk3r/hash_equals": "dev-master"
}

```

Basic Usage
-----------

[](#basic-usage)

The function should be available automatically after being added to composer (remember to run "composer update")

```
