https://github.com/rogervila/phashp
Combines different hash algos in order to create a strong hashed string.
https://github.com/rogervila/phashp
hash library password php security
Last synced: 5 months ago
JSON representation
Combines different hash algos in order to create a strong hashed string.
- Host: GitHub
- URL: https://github.com/rogervila/phashp
- Owner: rogervila
- License: mit
- Created: 2015-10-09T20:17:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-07T04:41:29.000Z (over 1 year ago)
- Last Synced: 2025-08-02T10:48:03.593Z (11 months ago)
- Topics: hash, library, password, php, security
- Language: PHP
- Size: 23.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phashp
[](https://travis-ci.org/rogervila/phashp)
[](https://ci.appveyor.com/project/roger-vila/phashp)
[](https://styleci.io/repos/43978114)
[](https://codeclimate.com/github/rogervila/phashp)
[](https://dependencyci.com/github/rogervila/phashp)
[](https://insight.sensiolabs.com/projects/cd4c4a22-7b0a-4d41-b1ea-0bf127729075)
Combines different hash algorithms in order to create a stronger hashed string.
[You can find the v1 docs here](https://github.com/rogervila/phashp/tree/1.0).
### Install
First, install [Composer](https://getcomposer.org/)
```sh
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
```
Then, require the library on your project
```sh
$ composer require rogervila/phashp
```
### Usage
```php
// 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](http://php.net/manual/en/function.hash-algos.php).
`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](https://github.com/rogervila/phashp/blob/master/LICENSE)