pedrosancao/php-random-data

small library generates high entropy random data

v1.0.0 2018-09-09 19:54 UTC

This package is auto-updated.

Last update: 2024-05-10 08:44:49 UTC


README

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