iwalkalone / random
It generates random strings
v1.3
2026-04-23 09:40 UTC
Requires (Dev)
- codeception/codeception: ^5.3
This package is auto-updated.
Last update: 2026-04-23 09:40:56 UTC
README
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.