xdev/randomize

Support random number, string, array, list

1.0.1 2021-03-18 16:19 UTC

This package is auto-updated.

Last update: 2025-06-28 16:53:34 UTC


README

This package will random number, string and element in the specific array.

Requirements

PHP >= 7.3

Composer > 1.0

How to use

run by composer

composer require xdev/randomize

Add package to your code

use Xdev\Support\Randomize\Random

call class Random and use static method

Methods

randomNumber ($min,$max):int

param type
min integer
max integer
It will random number from min to max that using rand function from php default. ### randomString ($length):string
param type
length integer
It will random string using using random_bytes and bin2hex function from php default. ### randomElementInArray ($neededArray):mixed
param type
neededArray array
It will random element in needed array.

License

MIT

Author

Kiden Snapter, Duy Lucas