mpstyle/rastris

1.0.0 2016-12-19 09:06 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:12:29 UTC


README

RAndom STRIngS generator.

Build Status

How to install

Simply add a dependency on mpstyle/rastris to your project's composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a development-time dependency on MpStyle Rastris:

{
    "require-dev": {
        "mpstyle/rastris": "1.*.*"
    }
}

or using console:

composer require "mpstyle/rastris=1.*.*"

How to use

Generate a random string (the length is 10 characters) using this subset of chars |!"£$%&/()=?^+§°ç@-.,;_<>€[]{}abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

$generator = new RandomCharsGenerator();
$str = $generator->get(10);

Generate a random string (the length is 10 characters) using this subset of chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

$generator = new RandomCharsGenerator();
$str = $generator->getAlphas(10);

Generate a random string (the length is 10 characters) using this subset of chars ABCDEFGHIJKLMNOPQRSTUVWXYZ

$generator = new RandomCharsGenerator();
$str = $generator->getUpperAlphas(10);

Generate a random string (the length is 10 characters) using this subset of chars abcdefghijklmnopqrstuvwxyz

$generator = new RandomCharsGenerator();
$str = $generator->getLowerAlphas(10);

Generate a random string (the length is 10 characters) using this subset of chars 1234567890

$generator = new RandomCharsGenerator();
$str = $generator->getDigits(10);

Run tests

In the root of the project run:

composer test