Download the PHP package hi-folks/rando-php without Composer

On this page you can find all versions of the php package hi-folks/rando-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rando-php

Rando-PHP

Testing RandoPHP 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:

With the fluent interface, you can control some things like:

Table of contents

Installation

You can install the package via composer:

Usage

To import the right class:

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:

You can generate a special character. A special character is one of '!"#$%&'()*+,-./:;<=>?@[]^_`{|}~':

Generate Boolean

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

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:

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

Generate an Integer

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

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

You can use a shortcut helper to generate an integer calling the constructor with min and max parameters:

Generate bytes

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

Generate a Date

Sometimes you want to obtain a random date. For example, you want to generate a random date:

By default, a date between the first day of the current year to the last day of the current year. If you want to define the range, for example, a range of 01 Jan 2020 to 10 Jan 2020, you can use min() and max() methods:

You can even specify your preferred format for the random date generated, by using the format() method:

You can use min() and max() with format() method:

With the latest example, you can obtain something like "05-Jan-2020".

Generate sequences

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

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

Or you might want numeric char sequences.

Or you might want alphabetical char sequences.

Yes, even both.

You want 20 lowercase chars:

You want 20 upper case chars:

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

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

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

Or you might want alphabetical char sequences with no duplicates.

Yes, even both and with no duplicates.

Random String

If you want to generate a random string (alphanumeric, only letters, only numbers, with no duplication, lower case, upper case etc) you can use random chars generation. To generate a string use Randomize::chars():

The default behavior is:

You can change the default values with some methods and parameters. Method to set the type of chars (numeric, alpha, alphanumeric...):

You have also some methods to "control" the output, for example, avoid duplications:

String with numeric chars ('0'-'9')

If you want to generate a string with 16 chars, made with numeric chars ('0'-'9'):

You could obtain something like this '3963233500573002'.

String with 20 chars, lower case, just letters, no dups

If you want to obtain a string with 20 chars, lower case and just letters ('a'-'z'), and you want to avoid character duplications ( alphaLowerCase() and unique() ):

You could obtain something like this: 'nmbsjhrgdyfxwoltqkzp'.

String with 20 chars, letters and special characters

If you want to obtain a string with 20 chars, with letters and special characters:

You could obtain something like this: 'IOgPckeGGifrD%DRy[*!'.

Draw random stuff

If you have a list of values and you want to extract/select/draw one or more elements, you could use the Draw class instead of Randomize. For using the Draw class you need to import it:

Suggest which programming language you could use in your next project (random)

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

Extract 3 JS frameworks you could use in your next project

Extract 3 JS frameworks (duplicates allowed)

Testing

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

Warning :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.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Submit ideas or feature requests or issues

Take a look if your request is already created https://github.com/Hi-Folks/rando-php/issues If it is not present, you can create a new one https://github.com/Hi-Folks/rando-php/issues/new

Credits

License

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


All versions of rando-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hi-folks/rando-php contains the following files

Loading the files please wait ....