iwalkalone/random

It generates random strings

Maintainers

Package info

git.iwalkalone.org/iwalkalone/Random

pkg:composer/iwalkalone/random

Statistics

Installs: 70

Dependents: 0

Suggesters: 0

v1.3 2026-04-23 09:40 UTC

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.