PHPackages                             pure-bencode/pure-bencode - 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. pure-bencode/pure-bencode

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

pure-bencode/pure-bencode
=========================

A simple and complete bencode encoder/decoder

1.1(12y ago)14146MIT

Since Mar 15Compare

[ Source](https://github.com/jesseschalken/pure-bencode)[ Packagist](https://packagist.org/packages/pure-bencode/pure-bencode)[ RSS](/packages/pure-bencode-pure-bencode/feed)WikiDiscussions Synced 4d ago

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

pure-bencode
============

[](#pure-bencode)

A simple, efficient and complete Bencode encoder/decoder for PHP.

### Installation

[](#installation)

Install [the composer package](https://packagist.org/packages/pure-bencode/pure-bencode).

### Usage

[](#usage)

```
use \PureBencode\Bencode;

// encode
$bencode = Bencode::encode($value);

// decode
$value   = Bencode::decode($bencode);
```

- `Bencode::encode()` accepts only PHP values which can be converted to their exact original by `Bencode::decode()`. Those are `int`s, `string`s and `array`s whose contents are also valid.
- `array`s with keys of the form *0, 1, 2...n* with be encoded as lists. All others will be encoded as dictionaries with their keys in sorted order.
- Any problems will result in a `\PureBencode\Exception` with an appropriate message.

That is all. Have fun `Bencode`ing!

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

4491d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1559204?v=4)[Jesse Schalken](/maintainers/jesseschalken)[@jesseschalken](https://github.com/jesseschalken)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pure-bencode-pure-bencode/health.svg)

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

###  Alternatives

[nativephp/mobile

NativePHP for Mobile

1.1k75.1k90](/packages/nativephp-mobile)

PHPackages © 2026

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