2017 © Pedro Peláez
 

library true-random

Interface for getting random datra from random.org

image

pixeloution/true-random

Interface for getting random datra from random.org

  • Wednesday, July 24, 2013
  • by pixeloution
  • Repository
  • 5 Watchers
  • 42 Stars
  • 571 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

TrulyRandom

Composer-compatible library to interact with random.org's API in order to generate truly random lists of integers, sequences of integers, and random alpha-numeric strings., (*1)

Random.org does limit the amount of random numbers/strings you can generate in a day, and this program will check your remaining quota before sending requests. If you need more than the free allowance, there are instructions on random.org for purchasing additional., (*2)

I have nothing to do with random.org other then thinking its a cool service., (*3)

Installation

Install via Packagist, (*4)

"require" : 
{ 
  "pixeloution/true-random" : "*" 
},

in your composer.json file, (*5)

Set-Up

use Pixeloution\Random\Randomizer;

# takes a partial User Agent as an argument; random.org requests you use your
# email address in case of issues
$generator = new Randomizer( 'name@example.com' );

Generate Lists of Integers

Returns an array of non-unique integers between min, max, (*6)

$generator->integers( $minimum_value, $maximum_value, $quantity );

Generate A Sequence of Integers

Returns an array of a integers from $start to $end, each integer appearing once., (*7)

$generator->sequence( $start, $end );

Generate a list of random strings

Returns an array of strings $length characters long, made up of character types specified via bitwise options. The default value is ALL ^ UNIQUE, (*8)

Options are: * Randomizer::DIGITS
* Randomizer::UPPERCASE * Randomizer::LOWERCASE * Randomizer::UNIQUE * Randomizer::ALL, (*9)

Some examples:, (*10)

# returns all strings containing uppercase and lowercase only
$generator->strings( $len, $qty, Randomizer::UPPERCASE | Randomizer::LOWERCASE );

# returns lowercase strings, no repeated letters
$generator->strings( $len, $qty, Randomizer::LOWERCASE | Randomizer::UNIQUE );

# returns uppercase, lowercase, numeric with non-unique charaters. this is the default
$generator->strings( $len, $qty, Randomizer::ALL ^ Randomizer::UNIQUE );    

The Versions

24/07 2013

dev-v2api

dev-v2api

Interface for getting random datra from random.org

  Sources   Download

The Requires

 

The Development Requires

21/07 2013

dev-master

9999999-dev

Interface for getting random datra from random.org

  Sources   Download

The Requires

 

The Development Requires

21/07 2013

1.0.0

1.0.0.0

Interface for getting random datra from random.org

  Sources   Download

The Requires

 

The Development Requires