PHPackages                             gladcodes/keygen - 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. gladcodes/keygen

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

gladcodes/keygen
================

A fluent PHP random key generator.

1.1.2(7y ago)119668.9k—0.2%17[2 issues](https://github.com/gladchinda/keygen-php/issues)[1 PRs](https://github.com/gladchinda/keygen-php/pulls)2MITPHPPHP &gt;=5.4.0

Since Jan 10Pushed 7y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (1)Versions (11)Used By (2)

Keygen
======

[](#keygen)

> A fluent PHP random key generator.

[![Packagist](https://camo.githubusercontent.com/d8a7a3c5eaec6ec074d5624c2ec4f61ca371be9ce55a38720af805009020413f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676c6164636f6465732f6b657967656e2e737667)](https://packagist.org/packages/gladcodes/keygen) [![Packagist](https://camo.githubusercontent.com/8565724100f9b12bcf907387b117670601940069464abc2d05e9c6e90be615a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676c6164636f6465732f6b657967656e2e737667)](https://packagist.org/packages/gladcodes/keygen) ![Packagist](https://camo.githubusercontent.com/ce6cf7bac298b3880d105beebcfc65d5dfc49e8effa6426c36dea6814b5c732f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676c6164636f6465732f6b657967656e2e737667)

Keygen is a PHP package that generates random character sequences known as *keys*. The package ships with built-in key generators for four key types namely: *numeric*, *alphanumeric*, *token* and *byte*. Its implementation effectively combines simplicity and expressiveness.

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

[](#installation)

### With Composer

[](#with-composer)

The Keygen package can be installed easily with \[Composer\] - require the `gladcodes/keygen` package from the command line.

```
$ composer require gladcodes/keygen
```

Alternatively, you can manually add the Keygen package to the `composer.json` file of your project and then run `composer install` from the command line as follows:

```
{
    "require": {
        "gladcodes/keygen": "~1.1"
    }
}
```

```
$ composer install
```

You can use it in your PHP code like this:

```
