aviate-labs / core.mo

Core Libraries for Motoko

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Core Libraries for Motoko

The core library is a curated collection of libraries designed to enhance and extend the functionality of the Motoko programming language. This repository aims to provide robust and efficient tools that are essential for building various applications in Motoko.

Content Table

Current Libraries

CBOR (Concise Binary Object Representation)

The CBOR library provides functions to encode and decode data in CBOR format, which is a compact data format designed for efficient data exchange.

import CBOR "mo:core/cbor/CBOR";

let value = encode(#TextString("Hello world!"));
// "\6C\48\65\6C\6C\6F\20\77\6F\72\6C\64\21"

Read more...

Certified Variables

Canister smart contracts can declare variables as certified. Whenever set, these variables will automatically get a Merkle tree certificate, signed by the Internet Computer blockchain. This allows anyone to verify the authenticity of this type of data using the Internet Computer's public key.

Read more...

Crypto

The Crypto library offers a collection of cryptographic functions and utilities, enabling secure data handling and operations within Motoko applications.

Read more...

SHA256

The SHA256 submodule provides a robust SHA-256 hashing function, crucial for creating secure digital fingerprints of data.

import SHA256 "mo:core/crypto/SHA256";

let hash = SHA256.sum(Blob.toArray(Text.encodeUtf8("Hello, world!")));

Encoding

The Encoding library includes various encoding schemes necessary for data manipulation and storage within Motoko applications.

Read more...

Binary

The Binary submodule allows for straightforward encoding and decoding of binary data, facilitating binary data handling in a variety of applications.

Hex

The Hex submodule provides functionalities to encode data into hexadecimal format and decode it back, which is useful for debugging and logging.

About

Core Libraries for Motoko

License:Apache License 2.0


Languages

Language:Motoko 99.1%Language:Makefile 0.5%Language:Dhall 0.4%