PHPackages                             minter/php-rlp - 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. minter/php-rlp

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

minter/php-rlp
==============

Recursive Length Prefix Encoding in PHP.

v1.0.0(6y ago)27.4k22MITPHP

Since Feb 1Pushed 6y ago3 watchersCompare

[ Source](https://github.com/MinterTeam/php-rlp)[ Packagist](https://packagist.org/packages/minter/php-rlp)[ RSS](/packages/minter-php-rlp/feed)WikiDiscussions master Synced 3d ago

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

rlp
===

[](#rlp)

Recursive Length Prefix Encoding in PHP.

[![Build Status](https://camo.githubusercontent.com/6e1a6fd81611beb7f673a7db28b67eb05d87f8ba491c191805a8f1a664c2d570/68747470733a2f2f7472617669732d63692e6f72672f77656233702f726c702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/web3p/rlp)[![codecov](https://camo.githubusercontent.com/f0ff0bfec3e644cd1ca891e11b3a683ccf4857f8001228ae8482544bab4362a2/68747470733a2f2f636f6465636f762e696f2f67682f77656233702f726c702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/web3p/rlp)[![Licensed under the MIT License](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://github.com/web3p/rlp/blob/master/LICENSE)

Install
=======

[](#install)

Set minimum stability to dev

```
composer require web3p/rlp

```

Usage
=====

[](#usage)

RLP encode:

```
use Web3p\RLP\RLP;

$rlp = new RLP;
$encodedBuffer = $rlp->encode(['dog']);

// to string, encoding: ascii utf8 hex
$encodedBuffer->toString($encoding);
```

RLP decode:

```
use Web3p\RLP\RLP;

$rlp = new RLP;
$encodedBuffer = $rlp->encode(['dog']);

// only accept 0x prefixed hex string
$decodedArray = $rlp->decode('0x' . $encodedBuffer);

// show dog
echo $decodedArray[0]->toString('utf8');
```

API
===

[](#api)

### Web3p\\RLP\\RLP

[](#web3prlprlp)

#### encode

[](#encode)

Returns recursive length prefix encoding of given data.

`encode(mixed $inputs)`

Mixed inputs - array of string, integer or numeric string.

###### Example

[](#example)

- Encode array of string.

```
use Web3p\RLP\RLP;

$rlp = new RLP;
$encodedBuffer = $rlp->encode(['web3p', 'ethereum', 'solidity']);
$encodedString = $encodedBuffer;
```

#### decode

[](#decode)

Returns array recursive length prefix decoding of given data.

`decode(string $input)`

String input - recursive length prefix encoded string.

###### Example

[](#example-1)

- Decode recursive length prefix encoded string.

```
use Web3p\RLP\RLP;

$rlp = new RLP;
$encodedBuffer = $rlp->encode(['web3p', 'ethereum', 'solidity']);
$encodedString = $encodedBuffer;
$decodedArray = $rlp->decode('0x' . $encodedString);

// echo web3p
echo $decodedArray[0]->toString('utf8');

// echo ethereum
echo $decodedArray[1]->toString('utf8');

// echo solidity
echo $decodedArray[2]->toString('utf8');
```

License
=======

[](#license)

MIT

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 81.4% 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 ~96 days

Recently: every ~172 days

Total

9

Last Release

2256d ago

Major Versions

0.2.4 → v1.0.02020-03-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/971c5a45b1096a296b8bdb7df6aa64e88206e9e0dbb276e13c4a65da2c417b98?d=identicon)[danil-lashin](/maintainers/danil-lashin)

---

Top Contributors

[![sc0Vu](https://avatars.githubusercontent.com/u/10494397?v=4)](https://github.com/sc0Vu "sc0Vu (48 commits)")[![grkamil](https://avatars.githubusercontent.com/u/10536620?v=4)](https://github.com/grkamil "grkamil (7 commits)")[![danil-lashin](https://avatars.githubusercontent.com/u/3121312?v=4)](https://github.com/danil-lashin "danil-lashin (2 commits)")[![vincentlg](https://avatars.githubusercontent.com/u/813911?v=4)](https://github.com/vincentlg "vincentlg (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/minter-php-rlp/health.svg)

```
[![Health](https://phpackages.com/badges/minter-php-rlp/health.svg)](https://phpackages.com/packages/minter-php-rlp)
```

PHPackages © 2026

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