2017 © Pedro Peláez
 

library number-generator

Generate numbers.

image

hylianshield/number-generator

Generate numbers.

  • Sunday, June 10, 2018
  • by johmanx10
  • Repository
  • 2 Watchers
  • 0 Stars
  • 140 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 75 % Grown

The README.md

Introduction

Build Status, (*1)

Generate a number or a list of numbers between a given minimum and maximum. The default implementation is based on the CSPRNG implementation introduced in PHP 7., (*2)

Installation

composer require hylianshield/number-generator:^1.0

Usage

<?php
use HylianShield\NumberGenerator\NumberGenerator;

$generator = new NumberGenerator();
$generator->generateNumber(); // Number between 0 and PHP_INT_MAX
$generator->generateNumber(12); // Number between 12 and PHP_INT_MAX
$generator->generateNumber(42, 1337); // Number between 42 and 1337

// List of 10 numbers between 42 and 1337.
$numbers = iterator_to_array(
    $generator->generateList(10, 42, 1337)
);

To generate an example, try running:, (*3)

composer example 10 42 1337

Output will be similar to:, (*4)

> ./examples/basic-range.php '10' '42' '1337'
685
993
472
977
876
997
459
281
529
1287

The Versions

10/06 2018

dev-master

9999999-dev

Generate numbers.

  Sources   Download

Apache-2.0

The Requires

  • php ^7.0

 

The Development Requires

28/02 2017

1.0.1

1.0.1.0

Generate numbers.

  Sources   Download

Apache-2.0

The Requires

  • php ^7.0

 

The Development Requires

29/01 2017

1.0.0

1.0.0.0

Generate numbers.

  Sources   Download

Apache-2.0

The Requires

  • php ^7.0

 

The Development Requires