https://github.com/dimensiondev/coda
Make Codec Interesting Again. ([I:b])
https://github.com/dimensiondev/coda
Last synced: 4 months ago
JSON representation
Make Codec Interesting Again. ([I:b])
- Host: GitHub
- URL: https://github.com/dimensiondev/coda
- Owner: DimensionDev
- License: agpl-3.0
- Created: 2020-05-11T05:51:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T08:29:20.000Z (over 5 years ago)
- Last Synced: 2025-02-15T12:52:45.679Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 280 KB
- Stars: 1
- Watchers: 8
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coda [![Node.js CI][workflow-badge]][workflow]
Make Codec Interesting Again. ([I:b])
## Usages
```javascript
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); // '🐟🔂🏁🤖💧🚊😤'
```
## Desc
All data will be formated into `Uint8Array` while we constructing the
Codec class, for example, Let's format the word `Mask`!
### Base1024Emoji
| Text | Binary | Index |
| :-----: | :--------: | :---: |
| 0x1f41f | 0100110101 | 309 |
| 0x1f502 | 1000010111 | 535 |
| 0x1f3c1 | 0011011010 | 218 |
| 0x1f694 | 1100000000 | 768 |
### UTF-8
| Text | Binary | Index |
| :--: | :------: | :---: |
| M | 01001101 | 77 |
| a | 01100001 | 97 |
| s | 01110011 | 115 |
| k | 01101011 | 107 |
### Base64
| Text | Binary | Index |
| :--: | :----: | :---: |
| T | 010011 | 19 |
| W | 010110 | 22 |
| F | 000101 | 5 |
| z | 110011 | 51 |
| a | 011010 | 26 |
| s | 110000 | 48 |
| = | 000000 | |
### Hex
| 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 |
## References
- [twemojis][twemojis]
- [Full Emoji List, v13.0][full-emoji-list]
## LICENSE
AGPL-3.0
[twemojis]: https://github.com/twitter/twemoji
[workflow]: https://github.com/DimensionDev/coda/actions?query=workflow%3A%22Node.js+CI%22
[workflow-badge]: https://github.com/DimensionDev/coda/workflows/Node.js%20CI/badge.svg
[full-emoji-list]: https://unicode.org/emoji/charts/full-emoji-list.html