mtwin-codec
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Codec implement of Codec

npm tests GitHub

This is the second generation of the Codec used by Motion Twin to encrypt client<>server exchanges in their games.

Note
If you are looking for how to use it, you can look at some examples in the unit tests.

Constructor

// generate `this.codec` (length 255) from key and version.
new Codec(key: String, ?version: String = "")

Variables

private b64: Array
private codec: Array

Methods

// return the encoding of `data` according to `this.codec` as a string.
public encode(data: String): String
// return the decoding of `data` according to `this.codec` as a string.
public decode(data: String): String
private code(data: String, ?mode: Int = 0): String

/mtwin-codec/

    Package Sidebar

    Install

    npm i mtwin-codec

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4.78 kB

    Total Files

    5

    Last publish

    Collaborators

    • angelisium