PHPackages                             monodesigns/randomstring - 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. monodesigns/randomstring

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

monodesigns/randomstring
========================

Generate random strings/passwords.

1.0(10y ago)027DBAD licensePHP

Since Dec 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/monodesigns/Randomstring)[ Packagist](https://packagist.org/packages/monodesigns/randomstring)[ RSS](/packages/monodesigns-randomstring/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Randomstring
============

[](#randomstring)

[![Travis](https://camo.githubusercontent.com/fa113bb59e01e94dcebed87904b3b855312489dd55f6a8be5cf048007703883b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6f6e6f64657369676e732f52616e646f6d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/monodesigns/Randomstring)[![License](https://camo.githubusercontent.com/4e214e076a301bc763812dd454d2f70e33f2271b6a5cc82561198b18e81d55fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6e6f64657369676e732f72616e646f6d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/monodesigns/randomstring)[![Version](https://camo.githubusercontent.com/ed8ccbb89ec64fe36cb0ad7e9bbee0b12a396b2a07d2419dfb89777118b441f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e6f64657369676e732f52616e646f6d737472696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/monodesigns/randomstring)

Installation
------------

[](#installation)

```
composer require monodesigns/randomstring

```

Usage
-----

[](#usage)

Randomstring is quite simple.

```
use monodesigns\Randomstring;

// default usage
Randomstring::generate() // 'qfaP4A'

// custom length (default = 6)
Randomstring::generate(['length' => 4]) // '9suF'

// custom types (default = 'upper lower number')
Randomstring::generate(['types' => 'upper lower']) // 'hWVHkW'

// all types (default = 'upper lower number')
Randomstring::generate(['types' => 'all']) // 'I`}dlN'

// hex
Randomstring::generate(['hex' => true]) // 'e36ad8'

// custom characters
Randomstring::generate(['custom' => '!@']) // '1pZW!Y'

```

Options
=======

[](#options)

```
Randomstring::generate([
  'length' => 6,
  'types' => 'upper lower number',
  'hex' => false,
  'custom' => ''
]);

// get / set characters for different types
Randomstring::$upper
Randomstring::$lower
Randomstring::$number
Randomstring::$symbol
Randomstring::$hex

```

If `hex` is true, it overrides anything set in the `types` option

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

3844d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e5cf9768827d3f3980027fb287b60f203f99240fb9f8d98c60d1f7c9f8fc675?d=identicon)[monodesigns](/maintainers/monodesigns)

---

Top Contributors

[![brian-p-ray](https://avatars.githubusercontent.com/u/375857?v=4)](https://github.com/brian-p-ray "brian-p-ray (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/monodesigns-randomstring/health.svg)

```
[![Health](https://phpackages.com/badges/monodesigns-randomstring/health.svg)](https://phpackages.com/packages/monodesigns-randomstring)
```

###  Alternatives

[mtrdesign/krait

Krait provides an easy way to create Ajax Datatables.

101.9k](/packages/mtrdesign-krait)

PHPackages © 2026

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