/php-random-data

Simple high entropy random data generator for Unix bases systems (for now)

Primary LanguagePHPMIT LicenseMIT

Simple high entropy random data generator

This small library generates high entropy random data from /dev/urandom

Aimed to UNIX based systems but has fallbacks for other systems

Formats

Generate data in these formats:

  • raw
  • integer
  • hexadecimal

Requirements

php >= 5.4

Installation

Preferable use composer

composer require pedrosancao/php-random-data

Usage

$bytes = \PedroSancao\Random::raw($length);
$int = \PedroSancao\Random::int($length);
$hex = \PedroSancao\Random::hex($length);

To do list

  • add new types (text, dummy base64, etc.)

Licence

MIT, see LICENCE.

Recommended reading