https://github.com/diodechain/motoko_base16
Base16 (Hex) Encoding and Decoding Library for Motoko
https://github.com/diodechain/motoko_base16
Last synced: 3 months ago
JSON representation
Base16 (Hex) Encoding and Decoding Library for Motoko
- Host: GitHub
- URL: https://github.com/diodechain/motoko_base16
- Owner: diodechain
- Created: 2024-11-11T11:28:18.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-11-11T11:30:29.000Z (7 months ago)
- Last Synced: 2025-01-19T08:32:27.567Z (4 months ago)
- Language: Motoko
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Motoko Base16 (Hex) Library
This library encodes and decodes base16 strings to blobs.
Example:
```
let encoded = Base16.encode(Blob.fromArray([0x00, 0x01, 0x02, 0x03]));
// "00010203"
let decoded = Base16.decode(encoded);
// ?Blob.fromArray([0x00, 0x01, 0x02, 0x03])
```Decoding returns a `?Blob` because the string may not be valid base16.
### MOPS
```
mops install base16
```# Testing
```
mops test
```