Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Last active April 18, 2018 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gladchinda/a7b254f0ba6840128991f0f7a4906970 to your computer and use it in GitHub Desktop.
Save gladchinda/a7b254f0ba6840128991f0f7a4906970 to your computer and use it in GitHub Desktop.
Code to test PHP Keygen package installation by just generating some random keys.
<?php
require __DIR__ . '/vendor/autoload.php';
use Keygen\Keygen;
$id_12 = Keygen::numeric(12)->generate();
$id_16 = Keygen::numeric()->generate();
$alnum = Keygen::alphanum(15)->generate();
$token = Keygen::token(28)->generate();
$bytes = Keygen::bytes(20)->generate();
$hex = Keygen::bytes(20)->hex()->generate();
echo $id_12; // 011683218639
echo $id_16; // 9352941287643963
echo $alnum; // TFd5X74Pr9ZOiG2
echo $token; // 4HE1xQz+4ks0Td128KSO/kBivd79
echo $bytes; // (some random byte chars)
echo $hex; // 9f802a80aaf4b5e89e14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment