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
CHANGELOG.md Update docs to use named params 3 days ago
CODE_OF_MERIT.md Remove hacked website 1 year ago
LICENSE.md start library 3 years ago
README.md Add simple examples to README 3 days ago
composer.json More sniffs 3 weeks ago
phpcs.xml Fix phpcs PHP version 1 week ago

README.md

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.

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

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.