base-cjk
v0.0.0
Published
BaseCJK is like Base64, but using CJK characters
Readme
BaseCJK
Similar to base64 and base45, BaseCJK encodes a string into CJK characters.
Since there are over 64² CJK characters, we can combine two ASCII characters into a single CJK character. This transformation is performed after first converting the string to base64 in a unicode-safe way.
For example, H becomes SA in base64, which becomes 劒 in BaseCJK. Likewise for Hi → SGk → 劘坤.
The generated CJK characters are usually nonsensical in every language.
Although BaseCJK appears to produce a shorter string then Base64, it is not an efficient data format, and there are vanishingly few situations where this is useful.
Usage
import { encode, decode } from 'base-cjk';
encode('hola😆'); // -> '咠嶩吷亡垮员'
decode('咠嶩吷亡垮员'); // -> 'hola😆'Magic Number
BaseCJK has no header or magic numbers to detect the encoding.
However, BaseCJK-encoded JSON will typically start with 嗐偈…, similar to Base64's distinctive ey… prefix.
