PHPackages                             checkthiscloud/crockford-random - 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. checkthiscloud/crockford-random

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

checkthiscloud/crockford-random
===============================

A PHP library for generating Crockford Base32 random strings

v1.0.5(4mo ago)02.4k↑916.7%[1 issues](https://github.com/CheckThisCloud/CrockfordRandom/issues)MITPHPPHP ^8.3CI passing

Since Sep 30Pushed 4mo agoCompare

[ Source](https://github.com/CheckThisCloud/CrockfordRandom)[ Packagist](https://packagist.org/packages/checkthiscloud/crockford-random)[ RSS](/packages/checkthiscloud-crockford-random/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (11)Used By (0)

CrockfordRandom
===============

[](#crockfordrandom)

[![CI](https://github.com/CheckThisCloud/CrockfordRandom/actions/workflows/ci.yml/badge.svg)](https://github.com/CheckThisCloud/CrockfordRandom/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/ceb882f3f92881f56a85edc63e55545f198b539c30f73af79841c9761ecc2487/68747470733a2f2f636f6465636f762e696f2f67682f436865636b54686973436c6f75642f43726f636b666f726452616e646f6d2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/CheckThisCloud/CrockfordRandom)[![PHP Version](https://camo.githubusercontent.com/5c8ce4571ddf4b6b8ca847e0c4c079de98fc6460eb7eae9c81ca63319c21f546/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e332d626c75652e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/5f27193e6312e2c9766b9b9fd5d14370fe91eaa2acdf0477ba3e8394906b7015/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636865636b74686973636c6f75642f63726f636b666f72642d72616e646f6d2e737667)](https://packagist.org/packages/checkthiscloud/crockford-random)[![Total Downloads](https://camo.githubusercontent.com/0d04d23310e83f143ddd556fd87b6d91c35f93c8f77fc7a856257b83e0e690a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636865636b74686973636c6f75642f63726f636b666f72642d72616e646f6d2e737667)](https://packagist.org/packages/checkthiscloud/crockford-random)

A PHP library for generating random strings using Crockford Base32 encoding alphabet.

Features
--------

[](#features)

- Generates cryptographically secure random strings using PHP 8.3+'s `Random\Randomizer`
- Uses Crockford Base32 alphabet: `0123456789ABCDEFGHJKMNPQRSTVWXYZ`
- Excludes ambiguous characters (I, L, O, U) for better readability
- Type-safe with strict typing enabled
- Comprehensive error handling
- Optional `brick/math` dependency for large unique pools (&gt; 1.15 quintillion codes)

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- `Random\Randomizer` extension (included in PHP 8.3+)

### Optional Dependencies

[](#optional-dependencies)

- `brick/math` (^0.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12) - Required only for `UniqueCrockfordPool` with lengths &gt; 12. For most use cases (pool lengths 1-12, which support up to 1.15 quintillion unique codes), native PHP integers are sufficient.

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

[](#installation)

```
composer require checkthiscloud/crockford-random
```

Usage
-----

[](#usage)

### Basic Random String Generation

[](#basic-random-string-generation)

```
