PHP Classes

bencoding: Serialize and unserialize values in bencode format

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 369 All time: 6,795 This week: 170Up
Version License PHP version Categories
bencoding 1.0GNU General Publi...5.0PHP 5, Data types


This class can be used to serialize and unserialize values in bencode format.

It can take a variable value and encode it as a string that describes its type and value in the bencode format. It supports encoding strings integers and arrays.

The class can also do the opposite, i.e. take a string in the bencode format and restore the original variable value.

Picture of Christoph Kappestein
Name: Christoph Kappestein <contact>
Classes: 3 packages by
Country: Germany Germany
Age: ???
All time rank: 2736164 in Germany Germany
Week rank: 578 Up30 in Germany Germany Up

bencoding - general This class is for encoding php types to the bencode syntax and decoding a bencode string to php types. You need this if you want to create/read a torrent file or create responses for a tracker. For more informations about bencode goto: I have developed this class for my framework psx <> but you can also use this outside. - description The following php/bencoding types are accosiated Type Bencode PHP ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ String 4:spam 'spam' Integer i3e 3 List l4:spam4:eggse array('spam', 'eggs') Dictionarie d3:cow3:moo4:spam4:eggse array('cow' => 'moo', 'spam' => 'eggs')
  Files folder image Files  
File Role Description
Plain text file bencoding.php Class main class
Accessible without login Plain text file example.php Example example script
Accessible without login Plain text file readme.txt Doc. documentation

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,795
This week:170Up