phuedx / tnetstring
A tagged netstring encoder/decoder for PHP.
Installs: 5 420
Dependents: 4
Suggesters: 1
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >= 5.2.17
Requires (Dev)
- phpunit/phpunit: 4.1.*
This package is not auto-updated.
Last update: 2024-11-20 11:25:36 UTC
README
A tagged netstring codec for PHP.
Installation
The recommended way to install TNetstring is with Composer.
composer.phar require phuedx/tnetstring
Usage
<?php require_once __DIR__.'/vendor/autoload.php'; $payload = array( 'authors' => array( array( 'name' => 'Sam Smith', 'email' => 'yo@samsmith.io', 'homepage' => 'https://github.com/phuedx', ), ), ); $codec = new \Phuedx\TNetstring\Codec(); $encoded = $codec->encode($payload); $decoded = $codec->decode($encoded);
There's also a JSON-like API:
$encoded = tnetstring_encode($payload); $decoded = tnetstring_decode($encoded);
Resources
tnetstrings.org had all of the information you'll need to get acquainted with tagged netstrings.
License
TNetstring is licensed under the MIT license and is copyright (c) 2011-2016 Sam Smith. See LICENSE for full copyright and license information.