PHPackages                             kevinkaske/random-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. kevinkaske/random-token

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

kevinkaske/random-token
=======================

A simple PHP lib to generate a random token.

033PHP

Since Mar 22Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

random-token
============

[](#random-token)

A simple function to generate a random token

Install via composer
--------------------

[](#install-via-composer)

Installation of random token is through [composer](https://getcomposer.org).

To get started quickly, run the following command

```
composer require kevinkaske/random-token
```

Usage
-----

[](#usage)

Call the following function to get a random token string. The default length is 40 characters;

```
getToken();
```

You can pass in another int for length if you need something longer or shorter than 40.

```
getToken(22);
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/172011?v=4)[Kevin Kaske](/maintainers/kevinkaske)[@kevinkaske](https://github.com/kevinkaske)

---

Top Contributors

[![kevinkaske](https://avatars.githubusercontent.com/u/172011?v=4)](https://github.com/kevinkaske "kevinkaske (5 commits)")

### Embed Badge

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

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

###  Alternatives

[drupol/phpermutations

Generators and iterators, permutations and combinations.

80713.5k5](/packages/drupol-phpermutations)

PHPackages © 2026

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