PHPackages                             defiant/randomorg - 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. defiant/randomorg

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

defiant/randomorg
=================

PHP class and Laravel implementation for Random.org

v1.0.0(9y ago)162.5k8[1 issues](https://github.com/defiant/randomorg/issues)PHPPHP &gt;=5.4.0

Since Oct 24Pushed 6y ago3 watchersCompare

[ Source](https://github.com/defiant/randomorg)[ Packagist](https://packagist.org/packages/defiant/randomorg)[ Docs](http://github.com/defiant/randomorg)[ RSS](/packages/defiant-randomorg/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

randomorg
=========

[](#randomorg)

Native PHP and Laravel Implementation of Random.org's JSON-RPC API

Installation with Composer
==========================

[](#installation-with-composer)

```
composer require defiant/randomorg

```

or add it in your composer.json require block.

```
{
    "require": {
        "defiant/randomorg": "1.*"
    }
}
```

and

```
composer update

```

Native PHP Usage
----------------

[](#native-php-usage)

```
$apiKey = '00000000-0000-0000-0000-000000000000';
$random = new RandomOrg\Random($apiKey);

// Simple method
// following functions returns 52 random non-repeating numbers between 1-52

$result = $random->generateIntegers(52, 1, 52, false);

// Signed methods
// following functions returns the above with signed data
$result = $random->generateIntegers(52, 1, 52, false, 10, true);

// Verify Signature
$verified = $random->verifySignature($result['result']['random'], $result['result']['signature']);
```

Laravel Usage
-------------

[](#laravel-usage)

- Register service provider in your `config/app.php` file.

```
RandomOrg\RandomServiceProvider::class
```

- Register the RandomOrg facade in the `aliases` key of your `config/app.php`

```
'RandomOrg' => RandomOrg\Facades\Random::class,
```

- Run a `vendor:publish` artisan command to publish your configuration assets to **`config/randomorg.php`**

```
$ php artisan vendor:publish --provider="RandomOrg\RandomServiceProvider"
```

You may set your API key directly in your `config/randomorg.php` file or in your **.env** file like so:

```
RANDOM_ORG_API_KEY=00000000-0000-0000-0000-000000000000

```

Example code:

```
use RandomOrg;

public function random()
{
    return RandomOrg::generateIntegers(52, 1, 52, false);
}
```

About API Keys
--------------

[](#about-api-keys)

You can get your own API key at

**Api Key (00000000-0000-0000-0000-000000000000) used in these examples will be disabled when the beta ends. Get your API key at **

For the native implementation, there are three methods where you can set the API key in your class.

First in the constructor:

```
$apiKey = '00000000-0000-0000-0000-000000000000';
$random = new RandomOrg\Random($apiKey);

```

Secondly you can set it directly your class

```
protected $apiKey = '00000000-0000-0000-0000-000000000000';

```

or you can use the setApi method

```
$apiKey = '00000000-0000-0000-0000-000000000000';
$random = new RandomOrg\Random();
$random->setApiKey($apiKey);

```

Note: Method names are the same with simple method names on the API. To make signed request an optional boolean parameter is needed as the final argument.

Currently supports simple and signed methods below. For more information see

- generateIntegers
- generateDecimalFractions
- generateGaussians
- generateStrings
- generateUUIDs
- generateBlobs
- getUsage
- generateSignedIntegers
- generateSignedDecimalFractions
- generateSignedGaussians
- generateSignedStrings
- generateSignedUUIDs
- generateSignedBlobs
- verifySignature

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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

Unknown

Total

1

Last Release

3539d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f0ee338536e2b9bb7a32c6f41a4808964b0d6159d81c1db0d6ead8fab65c5a5?d=identicon)[defiant](/maintainers/defiant)

---

Top Contributors

[![defiant](https://avatars.githubusercontent.com/u/89477?v=4)](https://github.com/defiant "defiant (10 commits)")[![youngbobby](https://avatars.githubusercontent.com/u/876261?v=4)](https://github.com/youngbobby "youngbobby (7 commits)")[![belamov](https://avatars.githubusercontent.com/u/13860486?v=4)](https://github.com/belamov "belamov (1 commits)")

---

Tags

randomrandom.org

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/defiant-randomorg/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M280](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M374](/packages/illuminate-redis)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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