2017 © Pedro Peláez
 

library trytes

Trytes encoder and decoder for arbitrary data

image

tuupola/trytes

Trytes encoder and decoder for arbitrary data

  • Saturday, December 23, 2017
  • by tuupola
  • Repository
  • 1 Watchers
  • 4 Stars
  • 44 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Trytes

This library implements Trytes encoding as described by IOTA project. Trytes are equivalent of bytes but in ternary number system., (*1)

Latest Version Software License Build Status Coverage, (*2)

Install

Install with composer., (*3)

``` bash $ composer require tuupola/trytes, (*4)


## Usage ``` php $trytes = new Tuupola\Trytes; $encoded = $trytes->encode(random_bytes(128)); $decoded = $trytes->decode($encoded);

Character sets

By default this library uses the IOTA style character set. Shortcut is provided also for Heptavintimal characters. If required you can use any custom character set of 27 unique characters., (*5)

use Tuupola\Trytes;

print Trytes::IOTA; /* 9ABCDEFGHIJKLMNOPQRSTUVWXYZ */
print Trytes::HEPTAVINTIMAL; /* 0123456789ABCDEFGHKMNPRTVXZ */

$default = new Trytes(["characters" => Trytes::IOTA]);
$heptavintimal = new Trytes(["characters" => Trytes::HEPTAVINTIMAL]);
print $default->encode("Hello world!"); /* RBTC9D9DCDEAKDCDFD9DSCFA */
print $heptavintimal->encode("Hello world!"); /* K2N304043451B4346404M361 */

Static Proxy

If you prefer to use static syntax use the provided static proxy., (*6)

``` php use Tuupola\TrytesProxy as Trytes;, (*7)

$encoded = Trytes::encode(random_bytes(128)); $decoded = Trytes::decode($encoded);, (*8)


## Testing You can run tests either manually or automatically on every code change. Automatic tests require [entr](http://entrproject.org/) to work. ``` bash $ make test

bash $ brew install entr $ make watch, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please email tuupola@appelsiini.net instead of using the issue tracker., (*11)

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

23/12 2017

dev-master

9999999-dev https://github.com/tuupola/trytes

Trytes encoder and decoder for arbitrary data

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

iota trytes

10/12 2017

0.1.0

0.1.0.0 https://github.com/tuupola/trytes

Trytes encoder and decoder for arbitrary data

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

iota trytes