PHPackages                             saggre/weighted-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. saggre/weighted-random

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

saggre/weighted-random
======================

Get weighted random samples using the alias method

1.0.0(3y ago)0454MITPHPPHP ^8.1

Since Jul 2Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Saggre/weighted-random)[ Packagist](https://packagist.org/packages/saggre/weighted-random)[ RSS](/packages/saggre-weighted-random/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

### README not available

The README for this package hasn't been synced yet. View it on [GitHub](https://github.com/Saggre/weighted-random).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

2

Last Release

1098d ago

Major Versions

0.0.1-RC1 → 1.0.02023-07-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13721842?v=4)[Sakri Koskimies](/maintainers/Saggre)[@Saggre](https://github.com/Saggre)

---

Top Contributors

[![Saggre](https://avatars.githubusercontent.com/u/13721842?v=4)](https://github.com/Saggre "Saggre (1 commits)")

---

Tags

randomfakeraliasprobabilityweightedsample

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saggre-weighted-random/health.svg)

```
[![Health](https://phpackages.com/badges/saggre-weighted-random/health.svg)](https://phpackages.com/packages/saggre-weighted-random)
```

###  Alternatives

[paragonie/random_compat

PHP 5.x polyfill for random\_bytes() and random\_int() from PHP 7

8.2k686.9M434](/packages/paragonie-random-compat)[fakerphp/faker

Faker is a PHP library that generates fake data for you.

4.0k390.0M4.6k](/packages/fakerphp-faker)[markrogoyski/math-php

Math Library for PHP. Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra

2.4k7.6M54](/packages/markrogoyski-math-php)[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84032.1M132](/packages/ircmaxell-random-lib)[ihor/nspl

Non-standard PHP library (NSPL) - functional primitives toolbox and more

375369.6k](/packages/ihor-nspl)[pragmarx/random

Create random chars, numbers, strings

744.6M5](/packages/pragmarx-random)

PHPackages © 2026

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