2017 © Pedro Peláez
 

library php-random-value

Secure random value generator.

image

ejfrancis/php-random-value

Secure random value generator.

  • Saturday, June 3, 2017
  • by ejfrancis
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHPRandomValue

PHPRandomValue is a PHP class for generating random values including numbers, text strings, and keys originally developed for use within the AlpineAuth library., (*1)

Random numbers are generated using mcrypt_create_iv(4, MCRYPT_DEV_URANDOM). Random text strings and keys (including letters and characters) are created by choosing characters at random using the number generator., (*2)

Installation

The recommended way to install is using composer, with the following require:, (*3)

"ejfrancis/php-random-value": "dev-master", (*4)

You can also download the classfile RandomValue.php and include it manually., (*5)

Example Usage and Output

include_once( 'RandomValue.php' );

$randomValue = new ejfrancis\RandomValue;

$randomValue->randomNumber(): //-3880998

$randomValue->randomNumberBetween(1,10): //2

$randomValue->randomTextString(): //CfCkKDHRgUULdGWcSqP4

$randomValue->randomTextString(10): //LorPIxaeEY

$randomValue->randomKey(): //C7al8tX9.gqYLf2ImVt/!$NOY79T5sNCT/6Q.$!.6Gf/Q5zpa3

$randomValue->randomKey(10): //RDV.dc6Ai/

$randomValue->randomStrongerKey(): //{I}s3897:}$xz4R@hpd!_+1L13[:_%1::pv/-asp2%4^#5$iG$F:{_Jf5s-98]raaqrhZ*Jg2k-nT-{9nBxsl!^dFI&21f"V:mU3

$randomValue->randomStrongerKey(15): //q:]qf941l[D&s8A

The Versions

03/06 2017

dev-master

9999999-dev

Secure random value generator.

  Sources   Download

MIT

The Requires

  • php >=5.3.0