PHPackages                             nuffleapp/nuffle - 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. nuffleapp/nuffle

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

nuffleapp/nuffle
================

Roll a die with any number of sides.

v1.0.4(9y ago)1341MITPHPPHP &gt;= 5.3.0

Since May 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/nuffleapp/nuffle-php)[ Packagist](https://packagist.org/packages/nuffleapp/nuffle)[ RSS](/packages/nuffleapp-nuffle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![Build Status](https://camo.githubusercontent.com/80131196f97ab0634200d2c13041e0d0f35d7babc1ea022a0fdba74de3a10363/68747470733a2f2f7472617669732d63692e6f72672f6e7566666c656170702f6e7566666c652d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nuffleapp/nuffle-php) [![codecov](https://camo.githubusercontent.com/015ced3fba05a0e968050434e1be37173b39e12bb62e4f85af7ed0b08c4b38d1/68747470733a2f2f636f6465636f762e696f2f67682f6e7566666c656170702f6e7566666c652d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/nuffleapp/nuffle-php) [![Gitter](https://camo.githubusercontent.com/6164d76f19c9a4ee092c813cf68a25959087df7b026b83db8ddd74f9cf3ee124/68747470733a2f2f6261646765732e6769747465722e696d2f6e7566666c656170702f6e7566666c652d7068702e737667)](https://gitter.im/nuffleapp/nuffle-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Packagist](https://camo.githubusercontent.com/373092b2a7ee531ca2fb0ba275e07595f5242ac4b9c4790d29fa870eb6587d58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e7566666c656170702f6e7566666c652e737667)](https://packagist.org/packages/nuffleapp/nuffle)

Nuffle, The PHP Library
=======================

[](#nuffle-the-php-library)

Nuffle, The PHP Library, is a dice calculator library that provides the functionality to perform complex dice rolls and calculate their result (ex: `5d6 + 1d20 / (1d6 - 2)`).

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

[](#installation)

### Via Composer

[](#via-composer)

Require the library and update via [Composer](https://getcomposer.org/):

```
composer require nuffleapp/nuffle
composer update

```

### Manually

[](#manually)

Download the [latest release](https://github.com/nuffleapp/nuffle-php/archive/master.zip), extract into a directory called `nuffle`, and include the library at the beginning of your script:

```
include_once('./nuffle/src/Nuffle.php');
use \Nuffle\Nuffle;

```

Usage
-----

[](#usage)

Nuffle is a dice calculator, allowing you to perform complex dice rolls and calculate their result. To do so, simply call the `roll()` method with your equation:

```
Nuffle::roll('5d6 + 1d20 / (1d6 - 2)')

```

That method will return an object that looks like the following:

```
{
   "rolls" : [
      {
         "notation" : "5d6",
         "rolls" : [
            2,
            1,
            2,
            4,
            5
         ]
      },
      {
         "notation" : "1d20",
         "rolls" : [
            11
         ]
      },
      {
         "rolls" : [
            4
         ],
         "notation" : "1d6"
      }
   ],
   "equation" : "(2 + 1 + 2 + 4 + 5) + (11) / ((4) - 2)",
   "result" : 19.5,
   "input" : "5d6 + 1d20 / (1d6 - 2)"
}

```

The object includes the value of each individual dice roll notation, the expanded equation, the equation result, and the original input.

Contributing
------------

[](#contributing)

Please read through our [contributing guidelines](CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.

Versioning
----------

[](#versioning)

For transparency into our release cycle and in striving to maintain backward compatibility, Nuffle is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible.

See [the Releases section of our GitHub project](https://github.com/nuffleapp/nuffle-php/releases) for changelogs for each release version of Nuffle.

Support
-------

[](#support)

The [issue tracker](https://github.com/nuffleapp/nuffle-php/issues) is the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests)and [submitting pull requests](#pull-requests).

For personal support requests, please use [Gitter](https://gitter.im/nuffleapp/nuffle-php) to get help.

Copyright and License
---------------------

[](#copyright-and-license)

Code and documentation copyright 2016 nuffleapp. Code released under [the MIT license](LICENSE).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

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

Every ~18 days

Recently: every ~26 days

Total

7

Last Release

3539d ago

Major Versions

v0.1.1 → v1.0.02016-05-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/67bef0cdfc520e70e1701ca43e4fc4cc3ebbfd9a15bf88570d3794e27c6a37a8?d=identicon)[zachflower](/maintainers/zachflower)

---

Top Contributors

[![zachflower](https://avatars.githubusercontent.com/u/920019?v=4)](https://github.com/zachflower "zachflower (21 commits)")

---

Tags

randomdiced20nuffle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nuffleapp-nuffle/health.svg)

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

###  Alternatives

[paragonie/random_compat

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

8.2k655.0M404](/packages/paragonie-random-compat)[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84130.2M119](/packages/ircmaxell-random-lib)[mistic100/randomcolor

Generate attractive random colors

2431.4M6](/packages/mistic100-randomcolor)[pragmarx/random

Create random chars, numbers, strings

714.2M5](/packages/pragmarx-random)[paragonie/random-lib

A Library For Generating Secure Random Numbers

703.3M26](/packages/paragonie-random-lib)[nubs/random-name-generator

A library to create interesting, sometimes entertaining, random names.

135680.2k3](/packages/nubs-random-name-generator)

PHPackages © 2026

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