PHPackages                             wandu-ar/randomist - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wandu-ar/randomist

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wandu-ar/randomist
==================

Librería para generar cadenas aleatorias.

v1.0.0(6y ago)0233MITPHPPHP &gt;=5.6

Since Nov 23Pushed 6y agoCompare

[ Source](https://github.com/wandu-ar/randomist)[ Packagist](https://packagist.org/packages/wandu-ar/randomist)[ RSS](/packages/wandu-ar-randomist/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Randomist
=========

[](#randomist)

[![Version 2.2](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667) [![MIT license](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667) [![Donate](https://camo.githubusercontent.com/2ee2c3802ed26d0340f0a534dbeb31e9fcbcbe2acf8333f8e45fdcc73ae83bf5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f676976652d646f6e6174696f6e2d79656c6c6f772e737667)](https://www.paypal.me/AleGueva)

Randomist is a PHP library for generate random string based on groups chars.

You can:

1. Combine the random string with numbers, lowercase and uppercase alpha chars and special chars.
2. Set the minimimus and maximus of every group of chars.
3. Create single or batch strings.
4. Use only URI safe specials chars.
5. Use a safe chars: is an special group of chars that can be easily recognized by childs or persons with poor computer capabilities. Are chars that don't confused with other similars chars depending the used font family.
6. Create a random lenght for random strings.

For example:

```
H*4qjcf4p8HB
EP26r49e
BKxTocZs9zcCcbitKFS2bCI6mwyBx1bTeMl1VOnBuS95Z03Xc4ZgRmssRqJC6Ittofo
1Fg@4B)*QRt@2e;B;ANArD(8Me@MQ
PG8LK
539108

```

Requerimients
-------------

[](#requerimients)

- PHP &gt;= 5.6

How to install
--------------

[](#how-to-install)

```
composer require wandu-ar/randomist
```

Usage
-----

[](#usage)

1. Add the following code at the beginning of your script.

```
use Wandu\Utils\Randomist;

$randomist = new Randomist();
```

2. Set preferences:

- Example 1: Secure password.

```
$secure_password =  $randomist
                        ->set_lenght(12)
                        ->include_number(3)
                        ->include_lowercase(3)
                        ->include_uppercase(3)
                        ->include_special(1, 1)
                        ->generate();

echo "1- Secure password: {$secure_password} \n\n";
```

Show: `1- Secure password: H*4qjcf4p8HB`

- Example 2: Multiple simple passwords.

```
$multiple_passwords =  $randomist
                        ->reset()
                        ->set_lenght(8)
                        ->include_number(4)
                        ->include_lowercase(2)
                        ->include_uppercase(2)
                        ->generate(10);

echo "2- Multiple simple passwords:\n".implode("\n", $multiple_passwords)."\n\n";
```

Show:

```
2- Multiple simple passwords:
EP26r49e
y76Tv30B
91s9NBd4
3vKi04Y0
kU270Pk0
l2Om884W
99iD73Ab
2M3d4o1S
4Bx9iI21
97Fx8Ko7

```

- Example 3: Random string as hash, for a key.

```
$random_hash =  $randomist
                    ->reset()
                    ->set_lenght(50, 80)
                    ->include_number(1)
                    ->include_lowercase(1)
                    ->include_uppercase(1)
                    ->generate();

echo "3- Random hash: {$random_hash}\n\n";
```

Show: `3- Random hash: BKxTocZs9zcCcbitKFS2bCI6mwyBx1bTeMl1VOnBuS95Z03Xc4ZgRmssRqJC6Ittofo`

- Example 4: Random hash URI safe.

```
$random_hash_uri_safe =  $randomist
                            ->reset()
                            ->set_lenght(30, 40)
                            ->only_safe()
                            ->include_number(1)
                            ->include_lowercase(1)
                            ->include_uppercase(1)
                            ->include_special(1)
                            ->generate();

echo "4- Random hash URI safe: {$random_hash_uri_safe}\n\n";
```

Show: `4- Random hash URI safe: .*~1;Fg@4B)*QRt@2e;B;ANArD(8Me@MQ`

- Example 5: Random string for simple captcha.

```
$captcha = $randomist
                ->reset()
                ->set_lenght(5)
                ->include_number(1)
                ->include_uppercase(1)
                ->generate();

echo "5- Random string for simple captcha: {$captcha}\n\n";
```

Show: `5- Random string for simple captcha: PG8LK`

- Example 6: Verification code.

```
$code = $randomist
            ->reset()
            ->set_lenght(6)
            ->include_number(1)
            ->generate();

echo "6- Verification code: {$code}\n\n";
```

Show: `6- Verification code: 539108`

More examples
-------------

[](#more-examples)

For a complete example script, visit the following script: [Examples](examples/index.php)

Roadmap
-------

[](#roadmap)

For the next version, predefined character groups can be modified because we will add an abstraction layer over them.

License
-------

[](#license)

[MIT](LICENSE)

Copyright (c) 2019 Wandu ® Argentina de Alejandro D. Guevara

Donate
------

[](#donate)

If you want, you can give me a cup of coffee :D | Make a [Donation](https://www.paypal.me/AleGueva)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2405d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/52f4b136c89afed67fe1ebce2859ed6c29f539277a1ab9a13a514b9e13f1b588?d=identicon)[alegueva](/maintainers/alegueva)

---

Top Contributors

[![adg-wandu](https://avatars.githubusercontent.com/u/47149614?v=4)](https://github.com/adg-wandu "adg-wandu (13 commits)")

### Embed Badge

![Health badge](/badges/wandu-ar-randomist/health.svg)

```
[![Health](https://phpackages.com/badges/wandu-ar-randomist/health.svg)](https://phpackages.com/packages/wandu-ar-randomist)
```

###  Alternatives

[mischiefcollective/colorjizz

Classes for manipulating colors, converting to different formats and finding color harmonies

285859.7k16](/packages/mischiefcollective-colorjizz)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[scriptfusion/byte-formatter

Formats byte values as human-readable strings.

43322.3k7](/packages/scriptfusion-byte-formatter)[elhebert/laravel-sri

Subresource Integrity hash generator for laravel

39241.9k](/packages/elhebert-laravel-sri)[z38/metzli

PHP library to generate Aztec barcodes

25325.2k](/packages/z38-metzli)[ddeboer/transcoder

Better encoding conversion for PHP

16714.7k10](/packages/ddeboer-transcoder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
