PHPackages                             jstewmc/create-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. jstewmc/create-token

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

jstewmc/create-token
====================

Create an opaque token

v1.0.0(9y ago)018MITPHPPHP ^7.0

Since Aug 13Pushed 9y ago1 watchersCompare

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

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

create-token
============

[](#create-token)

A create-token service.

```
use Jahuty\CreateToken\Create;

(new Create())(8);   // returns something like "12a8b53c"
(new Create())(16);  // returns something like "8ab5dfaef3d2c999"
```

Security
--------

[](#security)

This library uses the [random\_bytes()](http://php.net/manual/en/function.random-bytes.php) PHP function. According to PHP's manual, the function generates cryptographically secure, psuedo-random, opaque tokens suitable for salts, keys, and initialization vectors.

Length
------

[](#length)

Keep in mind, length is important when creating an opaque token. To provide sufficient randomness, a token's length SHOULD equal the length of the hash function's output. For example, a token that's hashed via SHA-256 should be 64 characters long; a token that's hashed via SHA-512 should be 128 characters long; so on and so forth.

License
-------

[](#license)

[MIT](https://github.com/jstewmc/create-token/blob/master/LICENSE)

Author
------

[](#author)

[Jack Clayton](mailto:clayjs0@gmail.com)

Version
-------

[](#version)

### 1.0.0, August 16, 2016

[](#100-august-16-2016)

- First major release

### 0.1.0, July 28, 2016

[](#010-july-28-2016)

- Initial release

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3608d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50fecae0a7fd2119681bc133e496e7166b01a59f850a3c909e100bd427c6b28b?d=identicon)[Jstewmc](/maintainers/Jstewmc)

---

Top Contributors

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

---

Tags

phptokencreatejstewmcopaque

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sinergi/token

PHP library to generate random strings

188.8k9](/packages/sinergi-token)[qinchen/web-utils

A web application common utils

111.5k](/packages/qinchen-web-utils)

PHPackages © 2026

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