PHPackages                             nechin/smart-hash - 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. nechin/smart-hash

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nechin/smart-hash
=================

A simple hash generator that makes it easy to get a hash for any text.

v1.2.0(5y ago)18MITPHPPHP &gt;=5.4

Since Jun 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nechin/smart-hash)[ Packagist](https://packagist.org/packages/nechin/smart-hash)[ Docs](https://nechin.github.io/smart-hash/)[ RSS](/packages/nechin-smart-hash/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

nechin/smart-hash
=================

[](#nechinsmart-hash)

[![Source Code](https://camo.githubusercontent.com/1743d7dd38806edb6e379b6fdb5e3469be2b0d958d1e8d63ce1a81ce6e7abdb1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d6e656368696e2f736d6172742d2d686173682d626c75653f7374796c653d666c61742d737175617265)](https://github.com/nechin/smart-hash)[![Latest Version](https://camo.githubusercontent.com/7a949039c3d24afc99548bad87bd6763ed3567babe9440e2de6dda586afb6b78/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6e656368696e2f736d6172742d686173683f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nechin/smart-hash)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/nechin/smart-hash/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/b4a6782d952996ee319385645bb4458deb01f463a9b77666407132a616ee686a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e656368696e2f736d6172742d686173683f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nechin/smart-hash)

About
-----

[](#about)

A simple hash generator that makes it easy to get a hash for any text.

From [Wikipedia](https://en.wikipedia.org/wiki/Hash_function):

> A hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. The values are used to index a fixed-size table called a hash table. Use of a hash function to index a hash table is called hashing or scatter storage addressing.

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

[](#installation)

The preferred method of installation is via [Packagist](https://packagist.org/packages/nechin/smart-hash) and [Composer](http://getcomposer.org/). Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require nechin/smart-hash
```

Requirements
------------

[](#requirements)

PHP 5.4.0

Examples
--------

[](#examples)

If no length is specified, the *ripemd128* algorithm is used, which will generate a string of 32 hexadecimal digits.

The following hash lengths are available: 8, 16, 32, 40, 48, 56, 64, 80, 96, 128. For each length is used its own optimal algorithm.

It is possible to specify the desired algorithm as the third parameter. Then the second parameter should be false.

```
