PHP Bencode (BitTorrent) Encoder/Decoder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anton Smirnov c79efcb3f5 Update docs to use named params 3 days ago
docs Update docs to use named params 3 days ago
src Make use of named properties 3 days ago
tests Update tests to use named params 3 days ago
.gitattributes Do not export tests and other build files 2 years ago
.gitignore Ignore vscode 1 week ago
.travis.yml For now always ignore platform 1 month ago Update docs to use named params 3 days ago Remove hacked website 1 year ago start library 3 years ago Add simple examples to README 3 days ago
composer.json More sniffs 3 weeks ago
phpcs.xml Fix phpcs PHP version 1 week ago

PHP Bencode Encoder/Decoder

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.


composer require 'sandfoxme/bencode'

Simple use


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


Read full documentation here:


Please file issues on our main repo at GitLab:


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