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: 370 This week: 1All time: 6,807 This week: 560Up
Version License PHP version Categories
bencoding 1.0GNU General Publi...5.0PHP 5, Data types
Description 

Author

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: 2730164 in Germany Germany
Week rank: 416 Up16 in Germany Germany Up

Details

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: http://bittorrent.org/beps/bep_0003.html I have developed this class for my framework psx <http://phpsx.org> 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  
 0%
Total:370
This week:1
All time:6,807
This week:560Up