arokettu / bencode
BitTorrent's Bencode encoder/decoder
Requires
- php: ^8.1
- arokettu/is-resource: ^1.0
Requires (Dev)
- ext-bcmath: *
- ext-gmp: *
- ext-json: *
- brick/math: *
- mikey179/vfsstream: ^1.6.11
- pear/math_biginteger: ^1.0
- phpunit/phpunit: ^10.5.28
- psy/psysh: *
- sandfox.dev/code-standard: ^1.2024.07.05
- squizlabs/php_codesniffer: *
- vimeo/psalm: ^5.2
Suggests
- php-64bit: Running 64 bit is recommended to prevent integer overflow
- ext-gmp: In case you need integers larger than your architecture supports
- brick/math: In case you need integers larger than your architecture supports
- pear/math_biginteger: In case you need integers larger than your architecture supports
- dev-master
- 4.3.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.0
- 3.x-dev
- 3.1.1
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-alpha1
- 2.x-dev
- 2.8.1
- 2.8.0
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.x-dev
- 1.8.1
- 1.8.0
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-10-11 15:26:32 UTC
README
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 'arokettu/bencode'
Supported versions:
- 4.x (current, PHP 8.1+)
Simple use
<?php \Arokettu\Bencode\Bencode::encode(['info' => ['length' => 12345, 'name' => 'Bencoded demo']]); \Arokettu\Bencode\Bencode::decode('d4:infod6:lengthi12345e4:name13:Bencoded demoee');
Documentation
Read full documentation here: https://sandfox.dev/php/bencode.html
Documentation for all past major versions can be found on Read the Docs:
- 1.x: https://bencode.readthedocs.io/en/1.x/
- 2.x: https://bencode.readthedocs.io/en/2.x/
- 3.x: https://bencode.readthedocs.io/en/3.x/
- 4.x: https://bencode.readthedocs.io/
Support
Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/bencode/-/issues
Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community
License
The library is available as open source under the terms of the MIT License.