LaravelPackages.net
Acme Inc.
Toggle sidebar
cornford/bencoded

An easy way to use bencoding in Laravel.

507
0
v3.1.0
About cornford/bencoded

cornford/bencoded is a Laravel package for an easy way to use bencoding in laravel.. It currently has 0 GitHub stars and 507 downloads on Packagist (latest version v3.1.0). Install it with composer require cornford/bencoded. Discover more Laravel packages by cornford or browse all Laravel packages to compare alternatives.

Last updated

An easy way to use bencoding with Laravel.

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality

For Laravel 5.x, check version 2.0.0

For Laravel 4.x, check version 1.0.0

Think of Bencoded as an easy way to use bencoding with Laravel. These include:

  • Bencoded::encode
  • Bencoded::decode

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require cornford/bencoded.

"require": {
    "cornford/bencoded": "2.*"
}

Next, update Composer from the Terminal:

composer update

Once this operation completes, the next step is to add the service provider. Open app/config/app.php, and add a new item to the providers array.

'Cornford\Bencoded\Providers\BencodedServiceProvider',

The final step is to introduce the facade. Open app/config/app.php, and add a new item to the aliases array.

'Bencoded'         => 'Cornford\Bencoded\Facades\BencodedFacade',

That's it! You're all set to go.

Usage

It's really as simple as using the Bencoded class in any Controller / Model / File you see fit with:

Bencoded::

This will give you access to

Encode

The encode method encodes an item into a bencoding format.

Bencoded::encode([['name' => 'tom'], ['name' => 'jerry']]);

Decode

The decode method decodes a bencoding string into PHP types.

Bencoded::decode('ld4:name3:tomed4:name5:jerryee);

License

Bencoded is open-sourced software licensed under the MIT license

Star History Chart