Skip to content

jslba/mtwin-codec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published