paragonie/random_compat
PHP 5.x support for random_bytes() and random_int() observed · 2026-08-28
Health v2 · maintenance only
54/100
- Activity 69
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4075
- days_rel: n/a
- days_push: 191
- n_releases_24m: 0
Adoption not part of the score
8154 stars · 153 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A PHP 5.x polyfill providing the random_bytes() and random_int() CSPRNG functions that were introduced in PHP 7. It fails with an exception rather than falling back to insecure randomness, making it secure-by-default.
Use cases
- generate cryptographically secure random bytes in php 5
- polyfill random_int for older php versions
- secure random token generation in legacy php apps
- support php 5 in a library that uses php 7 random functions
- avoid insecure mt_rand for randomness
When to choose
- you maintain a library or app that must support PHP 5.x and needs CSPRNG randomness
- you want a drop-in polyfill that never falls back to insecure random data
When to avoid
- you are on PHP 7 or newer, where random_bytes() and random_int() are built in
- you need general-purpose randomness rather than cryptographic randomness
Facets
library · maturity maintenance
cryptography security sdk security developer-tools programming-languages php polyfill csprng random-bytes random-int php5 secure-by-default
3 sources
- readme: https://github.com/paragonie/random_compat · fetched 2026-08-28 · b374ce6a5541
- homepage: https://paragonie.com/projects · fetched 2026-08-29 · cc0dd2480199
- site_page: https://paragonie.com/info · fetched 2026-08-29 · 2b4c8084191a
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| paragonie/random_compat | main | 54 |
For agents
markdown · JSON · MCP: product_card(name="paragonie/random_compat")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem