An open API service indexing awesome lists of open source software.

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

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
```