PHPackages                             basecardhero/randoms - 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. [API Development](/categories/api)
4. /
5. basecardhero/randoms

ActiveLibrary[API Development](/categories/api)

basecardhero/randoms
====================

A random.org api wrapper for php.

0.3.0(5y ago)019MITPHPPHP ^7.2CI failing

Since Nov 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/basecardhero/randoms)[ Packagist](https://packagist.org/packages/basecardhero/randoms)[ Docs](https://github.com/basecardhero/randoms)[ RSS](/packages/basecardhero-randoms/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

BaseCardHero - Randoms
======================

[](#basecardhero---randoms)

[![Build Status](https://camo.githubusercontent.com/3d50437c11b1b7612a9ac5b8fc303db5c68f74e3522b42fefa459cb6327547c2/68747470733a2f2f7472617669732d63692e636f6d2f62617365636172646865726f2f72616e646f6d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/basecardhero/randoms)[![codecov](https://camo.githubusercontent.com/f9dbf3a726994a430b23bd506cbe3f83f3bb091bc3a1868e291482a627ff0aa2/68747470733a2f2f636f6465636f762e696f2f67682f62617365636172646865726f2f72616e646f6d732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/basecardhero/randoms)

*This package was created for a project I am working on and does not fully support random.org services (or the way you may want it to). Feel free to add functionality by creating a pull request. See [contributing](CONTRIBUTING.md).*

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

[](#installation)

You can install the package via [composer](https://getcomposer.org/):

```
$ composer require basecardhero/randoms
```

Usage
-----

[](#usage)

You will need to configure the [Random.org API Key](https://api.random.org/).

### Examples

[](#examples)

#### Create a client instance

[](#create-a-client-instance)

```
require_once '/project/path/vendor/autoload.php';

$apiKey = '00000000-0000-0000-0000-0000000000';
$httpClient = new \BaseCardHero\Randoms\HttpClient();
$randomOrgClient = new \BaseCardHero\Randoms\RandomOrg\Client($apiKey, $httpClient);
```

#### generateSignedIntegers

[](#generatesignedintegers)

```
$response = $randomOrgClient->generateSignedIntegers(5, 0, 4, false, 10, 'some-id');
echo get_class($response); // \Psr\Http\Message\ResponseInterface
```

You can get the json response with the following.

```
$json_response = json_decode((string) $response->getBody(), true);
```

See [generateSignedIntegers](https://api.random.org/json-rpc/2/signed) for the respons structure.

#### getUsage

[](#getusage)

```
$response = $randomOrgClient->getUsage('some-id');
echo get_class($response); // \Psr\Http\Message\ResponseInterface
```

You can get the json response with the following.

```
$json_response = json_decode((string) $response->getBody(), true);
```

See [getUsage](https://api.random.org/json-rpc/2/signed) for the respons structure.

### Command line examples

[](#command-line-examples)

Before using the command line examples, be sure to set your api key.

```
export RANDOM_ORG_API_KEY=00000000-0000-0000-0000-0000000000
```

#### generateSignedIntegers

[](#generatesignedintegers-1)

```
php bin/generate-signed-integers.php
```

#### getUsage

[](#getusage-1)

```
php bin/get-usage.php
```

### Testing

[](#testing)

```
composer all
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

### Credits

[](#credits)

- [Base Card Hero](https://github.com/basecardhero) | [basecardhero.com](https://basecardhero.com/)
- [All Contributors](../../contributors)

### License

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

### PHP Package Boilerplate

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~125 days

Total

3

Last Release

2116d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29577813?v=4)[Base Card Hero](/maintainers/basecardhero)[@basecardhero](https://github.com/basecardhero)

---

Top Contributors

[![basecardhero](https://avatars.githubusercontent.com/u/29577813?v=4)](https://github.com/basecardhero "basecardhero (23 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/basecardhero-randoms/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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