My favorites | Sign in
Project Home Downloads Wiki Source
Search
for
Rych_Bencode  
Description of the Rych_Bencode component
Updated Aug 11, 2010 by rchouinard

Rych_Bencode

The Bencode component provides methods to encode and decode data with the bencode specification. Component usage is very simple:

<?php

$data = array (
  'fruit' => array (
    'apple',
    'banana',
    'pear'
  ),
  'numbers' => array (
    42,
    31337
  )
);

// Returns a bencoded string
$encoded = Rych_Bencode::encode($data);

// Returns a decoded array
$decoded = Rych_Bencode::decode($encoded);

Sign in to add a comment
Powered by Google Project Hosting