maikay / maihash
simple tool to generate a random hash
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 143
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/maikay/maihash
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2020-07-06 06:24:21 UTC
README
simple tool to generate a random hash
Installation
To install MaiHash put the following snippet to your composer.json:
{
"require": {
"maikay/maihash": "1.0.0"
}
}
Options
| option | description | default |
|---|---|---|
| min | min length of generated hash | 5 |
| max | max length of generated hash | 10 |
| char | haystack of all used chars | abcdefghijklmnopqrstuvwxyz[*] |
[*] abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
Examples
Just have a look at the examples
$generator = new \MaiHash\Generator();
Example #1 - invokable
$invokeOutput = $generator( array( 'min' => 5, 'max' => 10, 'chars' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', ) ); var_dump($invokeOutput); /* output */ string '75SORZ2L6I' (length=10)
Example #2 - method call
$methodOutput = $generator->getHash( array( 'min' => 10, 'max' => 15, 'chars' => 'abcdefghijklmnopqrstuvwxyz1234567890', ) ); var_dump($methodOutput); /* output */ string '8o8p6wz3hu325h1' (length=15)