Coda
Make Codec Interesting Again. ([I:b])
import { Codec, encode, decode ) from "@dimensiondev/coda";
const decoded = decode("Maskbook", Codec.UTF8);
encode(decoded, Codec.Hexadecimal); // '4d61736b626f6f6b'
encode(decoded, Codec.Base64); // 'TWFza2Jvb2s='
encode(decoded, Codec.Base1024Emoji); // 'ππππ€π§ππ€'
All data will be formated into Uint8Array
while we constructing the
Codec class, for example, Let's format the word Mask
!
Text |
Binary |
Index |
0x1f41f |
0100110101 |
309 |
0x1f502 |
1000010111 |
535 |
0x1f3c1 |
0011011010 |
218 |
0x1f694 |
1100000000 |
768 |
Text |
Binary |
Index |
M |
01001101 |
77 |
a |
01100001 |
97 |
s |
01110011 |
115 |
k |
01101011 |
107 |
Text |
Binary |
Index |
T |
010011 |
19 |
W |
010110 |
22 |
F |
000101 |
5 |
z |
110011 |
51 |
a |
011010 |
26 |
s |
110000 |
48 |
= |
000000 |
|
Text |
Binary |
Index |
4 |
0100 |
4 |
d |
1101 |
13 |
6 |
0110 |
6 |
1 |
0001 |
1 |
7 |
0111 |
7 |
3 |
0011 |
3 |
6 |
0110 |
6 |
b |
1011 |
11 |
AGPL-3.0