sandfoxme/bencode

BitTorrent's Bencode encoder/decoder

2.3.0 2020-10-04 14:06 UTC

This package is auto-updated.

Last update: 2020-10-19 16:13:37 UTC


README

Packagist Packagist Travis

Bencode is the encoding used by the peer-to-peer file sharing system BitTorrent for storing and transmitting loosely structured data.

This is a pure PHP library that allows you to encode and decode Bencode data.

Installation

composer require 'sandfoxme/bencode'

Simple use

<?php

\SandFox\Bencode\Bencode::encode(['info' => ['length' => 12345, 'name' => 'Bencoded demo']]);
\SandFox\Bencode\Bencode::decode('d4:infod6:lengthi12345e4:name13:Bencoded demoee');

Documentation

Read full documentation here: https://sandfox.dev/php/bencode.html

Documentation for earlier versions can be found on Read the Docs: https://bencode.readthedocs.io/en/1.x/

Support

Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/bencode/-/issues

License

The library is available as open source under the terms of the MIT License.