No description
Find a file
2025-09-08 15:06:45 +02:00
src Replacing tab with spaces. 2025-09-08 15:06:17 +02:00
tests First version of Random string generator. 2017-03-19 23:28:14 +01:00
.gitignore Updating library with a few improvements. 2025-09-06 19:22:48 +02:00
codeception.yml Updating library with a few improvements. 2025-09-06 19:22:48 +02:00
composer.json Updating library with a few improvements. 2025-09-06 19:22:48 +02:00
README.md Update README.md 2025-09-06 19:24:54 +02:00

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);

Allowed types are:

  • n: only numbers (0-9).
  • A: only capital letters (A-Z, except O to avoid confusion with number 0).
  • a: only lowercase letters (a-z, except l to avoid confusion with number 1).
  • An: capital letters and numbers (except letter O to avoid confusion with number 0).
  • an: lowercase letters and numbers (except letters i and number 1 to avoid confusions).
  • Aan: uppercase and lowercase letters plus numbers (except letter O and number 1).

By default, length is 8 and type is Aan.