vakata/random

A random int / string / byte generator

2.0.0 2017-06-02 15:05 UTC

This package is auto-updated.

Last update: 2024-10-10 05:16:47 UTC


README

Latest Version on Packagist Software License Build Status Code Climate Tests Coverage

A random int / string / byte generator for PHP.

Install

Via Composer

$ composer require vakata/random

Usage

// random 16 char alphanum string
\vakata\random\Generator::string(16);
// random 10 char hex string
\vakata\random\Generator::string(10, 'abcdef01234567890');
// random int between 0 and PHP_INT_MAX (inclusive)
\vakata\random\Generator::number();
// random int between 3 and 12 (inclusive)
\vakata\random\Generator::number(3, 12);
// 16 bytes
\vakata\random\Generator::bytes(16);

Read more in the API docs

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.