/bigint-encode

Encoding algorithm based on BigInt, encoding map support any(>=2) length.

Primary LanguageJavaScriptMozilla Public License 2.0MPL-2.0

BigInt Encode

将二进制数据以小端字节序视为大整数,转换为任意进制
在线

Base20976

使用20976个汉字/[\u4E00-\u9FEF]/作为编码表

let encoded = BigIntEncoder.base20976.encode('Hello World!')
//"觨鿊凂電踥鐽佡"
let decoded = BigIntEncoder.base20976.decodeString(encoded)

Base2048

基于BIP39

let encoded,decoded
encoded = BigIntEncoder.base2048Bip39CHS.encode('Hello World!')
//"尊扫芽定罢网啊附从"
decoded = BigIntEncoder.base2048Bip39CHS.decodeString(encoded)

encoded = BigIntEncoder.base2048Bip39EN.encode('Hello World!')
//"poverty ranch renew alone purity orange glory good around"
decoded = BigIntEncoder.base2048Bip39EN.decodeString(encoded)

切噜LE

使用切咧哔唎啪啰啵噜拉蹦十个字作为编码表

let encoded = BigIntEncoder['切噜LE'].encode('Hello World!')
//"切噜~♪啪哔哔唎噜啵哔啵啪哔唎拉啰哔拉唎啵咧咧啵啵切啰啪咧啪咧切唎"
let decoded = BigIntEncoder['切噜LE'].decodeString(encoded)