No description
- PHP 100%
| src | ||
| tests | ||
| .gitignore | ||
| codeception.yml | ||
| composer.json | ||
| README.md | ||
Random
It is a simple class to generate random alpha numeric strings to generate things like apikeys, passwords or recovery codes.
Install
composer require iwalkalone/random
How to use it
\iwalkalone\Random::generate($length, $type);
Example:
\iwalkalone\Random::generate(12, 'Aans');
Allowed types are:
- n: only numbers (0-9).
- A: only capital letters (A-Z).
- a: only lowercase letters (a-z).
- s: symbols (.,_#@-).
Note that if letters are combined with numbers some of letters and numbers are dropeed to avoid confusion.
By default, length is 8 and type is Aan.