boldizart/tokengenerator

Generate random token with your parameters.

dev-master 2018-07-10 07:29 UTC

This package is not auto-updated.

Last update: 2024-10-09 10:16:31 UTC


README

    // Create a random token with your parameters.
    token(
        (int)$length, 
        (bool)$lowercase, 
        (bool)$uppercase, 
        (bool)$numbers, 
        (bool)$specialCharacthers
    );

Installation:

    composer require boldizart/tokengenerator:dev-master;

Example:

<?php
    // Require the Composers autoloader.
    require 'vendor/autoload.php';

    // Use Tokengenerator classs.
    use Boldizart\Tokengenerator;

    $token = new Tokengenerator();

    // Create an 8 characther lenght token:
    print $token->token(8);
    print "<hr />";

    // Create a token with randon length which contains only lowercase characthers.
    print $token->token(0, true, false, false);
    print "<hr />";

    // Create a random token with randon length wich contains all characthers.
    print $token->token(0, true, true, true, true);