0.0.2 • Published 1 year ago

mtwin-codec v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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
0.0.2

1 year ago

0.0.1

1 year ago