sinergi/token

PHP library to generate random strings

Maintainers

👁 sinergi

Package info

github.com/sinergi/token

pkg:composer/sinergi/token

Statistics

Installs: 8 845

Dependents: 9

Suggesters: 0

Stars: 17

Open Issues: 3

0.1.0 2014-05-24 13:27 UTC

Requires

  • php: >=5.4.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c1c84108048245804671aa6fb7b82df6f1123275

phprandomidstringuuidtokenhexa

This package is not auto-updated.

Last update: 2026-06-20 23:46:25 UTC


README

👁 Build Status

A handful of tools for PHP developers.

Requirements

This library uses PHP 5.4+.

Installation

It is recommended that you install the Token library through composer. To do so, add the following lines to your composer.json file.

{
 "require": {
 "sinergi/token": "dev-master"
 }
}

Usage

use Sinergi\Token\StringGenerator;

StringGenerator::randomAlnum(32);

Methods

  • randomAlnum Generate alpha-numeric string

    • Parameters
    • int $length The length of the string to generate
    • Optional bool $onlyUppercase Use only uppercase letters
  • randomAlpha Generate alpha string

    • Parameters
    • int $length The length of the string to generate
    • Optional bool $onlyUppercase Use only uppercase letters
  • randomNumeric Generate numeric string

    • Parameters
    • int $length The length of the string to generate
  • randomHexa Generate hexa string

    • Parameters
    • int $length The length of the string to generate
  • randomUuid Generate uuid string

  • randomId Generate id string