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

ActiveLibrary

sofwar/randomorg
================

PHP class and Laravel implementation for Random.org

v1.0.0(9y ago)015PHPPHP &gt;=5.4.0

Since Oct 24Pushed 6y ago1 watchersCompare

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

READMEChangelogDependencies (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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

3493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c642bcbdec9d5400ef1dee14845681a886ace5c43cd80a6037daf919fdbe3505?d=identicon)[sofwar](/maintainers/sofwar)

---

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)")[![sofwar](https://avatars.githubusercontent.com/u/7130905?v=4)](https://github.com/sofwar "sofwar (3 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/sofwar-randomorg/health.svg)

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

###  Alternatives

[defiant/randomorg

PHP class and Laravel implementation for Random.org

162.5k](/packages/defiant-randomorg)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[webcraft/laravel-random

Laravel wrapper around paragonie/random-lib

1010.9k](/packages/webcraft-laravel-random)

PHPackages © 2026

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