All Projects → Hi-Folks → Rando Php

Hi-Folks / Rando Php

Licence: mit
RandoPhp is a open source library that implements random generators (Integer, Char, Byte, Sequences, Boolean) and take random sample from arrays

Projects that are alternatives of or similar to Rando Php

Gerador Validador Cpf
Biblioteca JS open-source para gerar e validar CPF.
Stars: ✭ 312 (+191.59%)
Mutual labels:  hacktoberfest, library, package, generator
Buttons & Co
Stars: ✭ 78 (-27.1%)
Mutual labels:  hacktoberfest, library
Spicy Proton
Generate a random English adjective-noun word pair in Ruby
Stars: ✭ 76 (-28.97%)
Mutual labels:  random, generator
Protobuf Nim
Protobuf implementation in pure Nim that leverages the power of the macro system to not depend on any external tools
Stars: ✭ 90 (-15.89%)
Mutual labels:  hacktoberfest, library
node package that converts a string to mOcKiNgCaSe
Stars: ✭ 74 (-30.84%)
Mutual labels:  hacktoberfest, package
Random Word
This is a simple python package to generate random english words
Stars: ✭ 75 (-29.91%)
Mutual labels:  package, random
Some python standard library functions ported to Nim
Stars: ✭ 88 (-17.76%)
Mutual labels:  hacktoberfest, library
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+9838.32%)
Mutual labels:  hacktoberfest, generator
Angular Librarian
An Angular 2+ scaffolding setup for creating libraries
Stars: ✭ 92 (-14.02%)
Mutual labels:  library, generator
Keygen Php
A fluent PHP random key generator.
Stars: ✭ 93 (-13.08%)
Mutual labels:  random, generator
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1142.06%)
Mutual labels:  hacktoberfest, generator
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+1002.8%)
Mutual labels:  hacktoberfest, library
Python toolbox / library for power system transient dynamics simulation with symbolic modeling and numerical analysis 🔥
Stars: ✭ 68 (-36.45%)
Mutual labels:  library, package
A simple python package having modules of different algorithms to use in educational purposes.
Stars: ✭ 76 (-28.97%)
Mutual labels:  hacktoberfest, package
Whisper is a file-based time-series database format for Graphite.
Stars: ✭ 1,121 (+947.66%)
Mutual labels:  hacktoberfest, library
Laravel Package Maker
Get a 📦 skeleton and all other `make` commands from laravel base for package development.
Stars: ✭ 89 (-16.82%)
Mutual labels:  hacktoberfest, package
A fuzzing library in JavaScript. ✨
Stars: ✭ 96 (-10.28%)
Mutual labels:  library, random
Lingua Franca
Mycroft's multilingual text parsing and formatting library
Stars: ✭ 51 (-52.34%)
Mutual labels:  hacktoberfest, library
Sanity Typed Queries
A typed, zero-dependency schema generator and query builder for Sanity.
Stars: ✭ 54 (-49.53%)
Mutual labels:  hacktoberfest, library
Laravel Totem
Manage Your Laravel Schedule From A Web Dashboard
Stars: ✭ 1,299 (+1114.02%)
Mutual labels:  hacktoberfest, package


CICD Github Actions GitHub last commit GitHub Release Date Packagist PHP Version Support


RandoPHP is a PHP open source package for random stuff. With this package you can:

  • Draw: Extract random items (sample) from an array. This is useful when you want to "draw" some numbers or items;
  • Generate: useful for create random
    • item like integer, byte, boolean, float, lat/long coordinates, char (numeric, alphabetic, alphanumeric);
    • sequences like array of integer or char;

With the fluent interface you can control some things like:

  • minimum and maximum value for generation;
  • how many items you want to create;
  • for sequences if you want or not duplicates ([1,5,3,1,1], 1 is duplicate or [1,6,5,3,8], no duplicates);
  • And other stuff, see the documentation for more options.

Table of contents


You can install the package via composer:

composer require hi-folks/rando-php


Generate Char

Sometimes you want to obtain a random char, for example, a numeric char:


Or you might want an alphabetic char:


You can even do both!


You can generate a lower case char:


You can generate an upper case char:


Generate Boolean

Sometimes you want to obtain a random boolean true or false (flip a coin):

$randomBool = Randomize::boolean()->generate();

Generate a Float

Sometimes you want to obtain a random float (default min - max range of 0.0 - 1.0). For example, you want to generate a random temperature for a day:

$randomFloat = Randomize::float()->generate();

Or you can set the min - max range of 0 - 90 , which is equivalent to ->min(0)->max(90)

$randomFloat = Randomize::float()->min(0)->max(90)->generate();

Generate an Integer

Sometimes you want to obtain a random integer (min - max range). For example, you want to roll the dice:

$randomNumber = Randomize::integer()->min(1)->max(6)->generate();

The same thing using range() method, instead of min() and max():

$randomNumber = Randomize::integer()->range(1,6)->generate();

Generate bytes

Sometime you want to obtain some random bytes (hexadecimal). For example, you want to generate a random RGB color (a hex triplet in hexadecimal format):

$randomRGB = Randomize::byte()->length(3)->generate();

Generate a Date

Sometimes you want to obtain a random date (default min - max range of First day of current year - Last day of current year). For example, you want to generate a random date:

$randomDate = Randomize::datetime()->generate();

Or you can set the min - max range of 01-01-2020 - 10-01-2020 , which is equivalent to ->min('01-01-2020')->max('10-01-2020'):

$randomDate = Randomize::datetime()->min('01-01-2020')->max('10-01-2020')->generate();

You can even specify your preferred format for the random date generated, by using ->format('d-M-Y'):

$randomDate = Randomize::datetime()->format('d-M-Y')->generate();

Generate sequences

Sometime you want to obtain some random sequences. For example, you want to roll the dice 15 times:

$randomRolls = Randomize::sequence()->min(1)->max(6)->count(15)->generate();

Sometime you want to obtain some random char sequences. For example, char sequences of length 10:

$randomChars = Randomize::sequence()->chars()->count(10)->generate();

Or you might want numeric char sequences.

$randomChars = Randomize::sequence()->chars()->numeric()->count(10)->generate();

Or you might want alphabetical char sequences.

$randomChars = Randomize::sequence()->chars()->alpha()->count(10)->generate();

Yes, even both.

$randomChars = Randomize::sequence()->chars()->alphanumeric()->count(10)->generate();

Sometime you want to obtain some random sequences with no duplicates. For example, you want to play "Tombola" (extracting number from 1 to 90 with NO duplicates):

$randomTombola = Randomize::sequence()->min(1)->max(90)->count(90)->noDuplicates()->generate();

Sometime you want to obtain some random char sequences with no duplicates.

$randomChars = Randomize::sequence()->chars()->count(10)->noDuplicates()->generate();

Or you might want numeric char sequences with no duplicates. For example, char sequences of length 10:

$randomChars = Randomize::sequence()->chars()->numeric()->count(10)->noDuplicates()->generate();

Or you might want alphabetical char sequences with no duplicates.

$randomChars = Randomize::sequence()->chars()->alpha()->count(10)->noDuplicates()->generate();

Yes, even both and with no duplicates.

$randomChars = Randomize::sequence()->chars()->alphanumeric()->count(10)->noDuplicates()->generate();

Draw random stuff

If you have a list of values and you want to extract/select/draw one or more elements, you could use Draw class instead of Randomize.

Suggest which JS framework you could use in your next project (random)

$array=["React.js", "Vue.js", "Svelte.js", "Angular.js" , "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->extract();

Extract 3 JS framework you could use in your next project

$array=["React.js", "Vue.js", "Svelte.js", "Angular.js" , "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->count(3)->extract();

Extract 3 JS framework (duplicates allowed)

$array = ["React.js", "Vue.js", "Svelte.js", "Angular.js", "Alpine.js", "Vanilla js"];
$randomJs = Draw::sample($array)->count(3)->allowDuplicates()->extract();


composer test

If you want to see some coverage report you can execute phpunit with coverage-text option:

vendor/bin/phpunit --coverage-text

Warning ⚠️

Under the hood RandoPHP uses some native PHP functions like:

These PHP functions use a pseudo random number generator that is not suitable for cryptographic purposes.


Please see CHANGELOG for more information what has changed recently.


Please see CONTRIBUTING for details.

Submit ideas or feature requests or issues

Take a look if your request is already there If it is not present, you can create a new one



The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected]