rogervila/phashp

Combines different hashing algorithms in order to create a strong hashed string

1.0.0 2015-11-19 19:57 UTC

README

Build Status Build status StyleCI Code Climate Dependency Status SensioLabsInsight

Combines different hash algorithms in order to create a stronger hashed string.

You can find the v1 docs here.

Install

First, install Composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Then, require the library on your project

$ composer require rogervila/phashp

Usage

// Simple usage
Phashp::hash('stringToHash');

// Full options
Phashp::algos(['sha1', 'sha256'])->cycles(2)->output('sha512')->hash('stringToHash');

Docs

algos() accepts an array of valid hashing algorithms. You can find which ones you can use on your current PHP version with PHP hash_algos() method.

cycles() accepts an integer greater than 0, that will determine the amount of cycles.

WARNING: a high amount of cycles can make PHP run out of memory.

output() accepts a valid hashing algorithm. The processed string will be returned in that hash algorithm format.

hash() the only mandatory method. It accepts the string that will be processed. It must go at the end of the fluent concatenation.

License

MIT