2017 © Pedro Peláez
 

library rng

The secure Pseudo Random Number Generator (PRNG) for PHP.

image

clickalicious/rng

The secure Pseudo Random Number Generator (PRNG) for PHP.

  • Sunday, April 30, 2017
  • by clickalicious
  • Repository
  • 3 Watchers
  • 0 Stars
  • 2,861 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

, (*1)


Logo of rng, (*2)

The secure Pseudo Random Number Generator PRNG for PHP., (*3)

Build Status Codacy branch grade Codacy coverage clickalicious open source
GitHub release license Issue Stats Dependency Status

Table of Contents

Features

  • Provides a secure PRNG: pseudo random number generator (64-Bit support)
  • OOP facade to PHP core functionality
  • High performance (developed using a profiler)
  • Lightweight and high-quality codebase (following PSR standards e.g. PSR-1,2,4)
  • Stable, clean + well documented code
  • Unit-tested with a good coverage

Examples

Generate random number between 1 and 10 using OPEN_SSL random bytes (library default):, (*4)

$generator = new \Clickalicious\Rng\Generator();
$number    = $generator->generate(1, 10);
echo $number;

Generate random number between 1 and 10 using PHP_MERSENNE_TWISTER random bytes:, (*5)

$generator = new \Clickalicious\Rng\Generator(\Clickalicious\Rng\Generator::MODE_PHP_MERSENNE_TWISTER);
$number    = $generator->generate(1, 10);
echo $number;

Generate 16 random bytes using MODE_OPEN_SSL random bytes (library default):, (*6)

$generator = new \Clickalicious\Rng\Generator();
$bytes     = $generator->getRandomBytes(16);

Generate 32 random bytes using NATIVE-PHP random bytes:, (*7)

$generator = new \Clickalicious\Rng\Generator();
$bytes     = $generator->getRandomBytes(32);

Visualization

You can create a visualization of randomization (as you can see below but larger size) through visual.php » (the file is located in root). As you may see: The first square (light grey) is the default PHP random generated noise which is aligned by a pattern (you will see in the large version of the picture). The following three squares a generated using a more secure generator like Open-SSL for example., (*8)

Logo of rng, (*9)

Requirements

  • PHP >= 5.6 (compatible up to version 7.2 as well as HHVM)

Philosophy

This library provides a state of the art PRNG (Pseudo Random Number Generator) implementation to generate secure Pseudo Random Numbers with PHP. The generation is either based on Open SSL or MCrypt or as fallback on PHP's internal functionality. The library also provides a very good Seed generator on puplic API. If you are interested in the difference between real and pseduo randomness then you could start at https://www.random.org/randomness/., (*10)

Scott Adams, (*11)

DILBERT © 2001 Scott Adams., (*12)

Versioning

For a consistent versioning i decided to make use of Semantic Versioning 2.0.0 http://semver.org. Its easy to understand, very common and known from many other software projects., (*13)

Roadmap

  • No open issues.

Throughput Graph, (*14)

Security Issues

If you encounter a (potential) security issue don't hesitate to get in contact with us opensource@clickalicious.de before releasing it to the public. So i get a chance to prepare and release an update before the issue is getting shared. Thank you!, (*15)

Participate & Share

... yeah. If you're a code monkey too - maybe we can build a force ;) If you would like to participate in either Code, Comments, Documentation, Wiki, Bug-Reports, Unit-Tests, Bug-Fixes, Feedback and/or Critic then please let me know as well! , (*16)

Sponsors

Thanks to our sponsors and supporters:, (*17)

JetBrains Navicat
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

The Versions

30/04 2017

dev-master

9999999-dev https://github.com/clickalicious/rng

The secure Pseudo Random Number Generator (PRNG) for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

30/04 2017

v3.0.0

3.0.0.0 https://github.com/clickalicious/rng

The secure Pseudo Random Number Generator (PRNG) for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

30/04 2017

dev-develop

dev-develop https://github.com/clickalicious/rng

The secure Pseudo Random Number Generator (PRNG) for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

10/03 2017

v2.0.1

2.0.1.0 https://github.com/clickalicious/rng

rng - The secure Pseudo Random Number Generator PRNG for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

10/03 2017

v2.0.0

2.0.0.0 https://github.com/clickalicious/rng

rng - The secure Pseudo Random Number Generator PRNG for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

09/04 2016

v1.1.0

1.1.0.0 https://github.com/clickalicious/Rng

Rng - The secure random number generator (PRNG) for PHP

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

03/04 2016

v1.0.0

1.0.0.0 https://github.com/clickalicious/Rng

Rng - The random number generator for PHP

  Sources   Download

BSD-2.0

The Requires

 

The Development Requires

generator openssl number random prng rng mersenne randomize mtcrypt

23/03 2015

v0.1.0

0.1.0.0 https://github.com/clickalicious/Rng

Random number generator for PHP

  Sources   Download

The BSD License

The Requires

  • php >=5.3.0

 

The Development Requires

number random clickalicious prng rng randomize