ecoji-d π¦ππ¦πΌπ½πββ [](http://code.dlang.org/packages/ecoji-d)[](https://github.com/ohdatboi/ecoji-d/blob/master/LICENSE)[](https://travis-ci.org/ohdatboi/ecoji-d)
March 14, 2018 Β· View on GitHub
ecoji-d implements Ecoji encoding standard using the D programming language.
Ecoji-d encodes data as base1024 but with emoji character set.
Usage
ecoji-d can be used both as a library or as a CLI utility, in both cases D compiler and dub are required:
As a library
Installation
You can find ecoji-d on the D package registry.
API
API consists of 2 modules:
- ecoji.d.encode, which provides encoding functionality
- ecoji.d.decode, which provides decoding functionality
You can import modules individally or import ecoji.d which will do this for you:
import ecoji.d;
Once it is imported you can call functions of ecoji-d:
auto encode(Range)(Range r) if(isInputRange!Range && is(ElementType!Range : ubyte));
This function takes a range of ubytes or chars and returns a range of dchars.
auto decode(Range)(Range r) if(isInputRange!Range && is(ElementType!Range : dchar));
This functions takes a range of dchars and returns a range of ubytes.
Both encoding and decoding happen lazily which decreases memory consumption and increases speed.
As a CLI utility
Installation
$ dub fetch ecoji-d
Usage
$ dub run ecoji-d -- [OPTIONS] [FILES]
Usage: ./ecoji-d [OPTIONS] [FILES]
-e --encode Encode data (default).
-d --decode Decode data.
-o --output Output file (default: stdout).
-h --help This help information.
If no input file is specified, stdin is used.