KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
crypto.mo
★ 10
Open GitHub ↗
Crypto Package for Motoko
Download README (.md)
Explore Similar Repositories
k8s-docker-registry
:
Kubernetes manifest files and instructions for deploying a Docker Registry and web user interface.
monaco-mermaid
:
Monaco language and theme support for mermaidJS
tf_seq2seq_losses
:
TensorFlow implementations of losses for sequence to sequence machine learning models
widgets
:
A simple client/server app to render widgets defined by a JSON file onto a web browser page.
Endurance
:
A Library Management software built with ASP.NET Core and Blazor
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
crypto.mo
?
Download (.md)
# Crypto Package for Motoko ## Packages | Package Name | Description | Spec | Path | |--------------|-------------|------|------| | SHA | SHA224 and SHA256 hash algorithms | FIPS 180-4 | `crypto/SHA/..` | | AES | Advanced Encryption Standard (AES) | FIPS 197 | `crypto/AES` | | HMAC | Keyed-Hash Message Authentication Code (HMAC) | FIPS 198-1 | `crypto/HMAC` | ## Usage ### SHA ```motoko SHA256.sum(Blob.toArray(Text.encodeUtf8("hello world\n")); // "a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447" let h = SHA256.New(); h.write(Blob.toArray(Text.encodeUtf8("hello world\n"))); h.sum([]); // "a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447" ``` ### HMAC ```motoko let h = HMAC.New(SHA256.New, []); h.write(Blob.toArray(Text.encodeUtf8("hello world\n"))); h.sum([]); // "d4452dbfe1fe25bf6c2fa79172dae3d7e2950de69f76e6c23188c49bfba4372f" ```