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)0464MITPHPPHP ^8.1

Since Jul 2Pushed 6mo 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 2w 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

34

—

LowBetter than 74% of packages

Maintenance47

Moderate activity, may be stable

Popularity15

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

1143d 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.2k698.3M445](/packages/paragonie-random-compat)[fakerphp/faker

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

4.0k401.1M5.2k](/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.8M58](/packages/markrogoyski-math-php)[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84032.7M136](/packages/ircmaxell-random-lib)[ihor/nspl

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

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

Create random chars, numbers, strings

704.7M5](/packages/pragmarx-random)

PHPackages © 2026

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