PHPackages                             pi-qo/token-generator - 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. [Security](/categories/security)
4. /
5. pi-qo/token-generator

ActiveLibrary[Security](/categories/security)

pi-qo/token-generator
=====================

Package to generate cryptographically secure tokens in PHP.

v1.0.1(5y ago)02MITPHPPHP ^7.2

Since Aug 9Pushed 5y agoCompare

[ Source](https://github.com/pi-qo/token-generator)[ Packagist](https://packagist.org/packages/pi-qo/token-generator)[ RSS](/packages/pi-qo-token-generator/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

token-generator
===============

[](#token-generator)

Package to generate cryptographically correct tokens in PHP.

Usage
=====

[](#usage)

It is pretty simple to use this tiny library. The first thing to do is to include Composer autoloader.

```
require_once __DIR__ . '/vendor/autoload.php';

use PiQo\Token;
```

Then the token is generated when the class is instanciated. The default length is 32 bytes, you can use the one you want by providing it to the constructor.

```
$generated = new Token(64);
$token = $generated->getHex(); // Human readable
$token = $generated->getRaw(); // for the raw generated token
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~0 days

Total

2

Last Release

2099d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8355639?v=4)[YayNay](/maintainers/PiQo)[@piqo](https://github.com/piqo)

---

Top Contributors

[![d9beuD](https://avatars.githubusercontent.com/u/53569029?v=4)](https://github.com/d9beuD "d9beuD (9 commits)")

### Embed Badge

![Health badge](/badges/pi-qo-token-generator/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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