PHPackages                             sinergi/token - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sinergi/token

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sinergi/token
=============

PHP library to generate random strings

0.1.0(11y ago)188.7k5[3 issues](https://github.com/sinergi/token/issues)9MITPHPPHP &gt;=5.4.0

Since May 24Pushed 6y ago3 watchersCompare

[ Source](https://github.com/sinergi/token)[ Packagist](https://packagist.org/packages/sinergi/token)[ RSS](/packages/sinergi-token/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (9)

Token
=====

[](#token)

[![Build Status](https://camo.githubusercontent.com/cf56b54ea535820dfc23b949c35a875eb4837283d5c948c12f37f6f0504a6aaa/68747470733a2f2f7472617669732d63692e6f72672f73696e657267692f746f6b656e2e737667)](https://travis-ci.org/sinergi/token)

A handful of tools for PHP developers.

Requirements
------------

[](#requirements)

This library uses PHP 5.4+.

Installation
------------

[](#installation)

It is recommended that you install the Token library [through composer](http://getcomposer.org/). To do so, add the following lines to your `composer.json` file.

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

Usage
-----

[](#usage)

```
use Sinergi\Token\StringGenerator;

StringGenerator::randomAlnum(32);
```

### Methods

[](#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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3b6bf01b626fd571d50bbbe004923f52f6cdd3f4e1ba97066ada146688524d6?d=identicon)[sinergi](/maintainers/sinergi)

---

Top Contributors

[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![gabrielbull](https://avatars.githubusercontent.com/u/671923?v=4)](https://github.com/gabrielbull "gabrielbull (1 commits)")

---

Tags

randomphpstringtokenuuididhexa

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sinergi-token/health.svg)

```
[![Health](https://phpackages.com/badges/sinergi-token/health.svg)](https://phpackages.com/packages/sinergi-token)
```

###  Alternatives

[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[fab2s/souuid

Simple Ordered Uuid Generator in PHP

13573.2k1](/packages/fab2s-souuid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
