The SHA Package
This package implements secure hash algorithms for the Motoko programming language.
Usage
Calculate a SHA256 hash.
public func sha256(data : [Nat8]) : [Nat8]
The SHA Package
Home Page: https://sdk.dfinity.org
License: Apache License 2.0
I'm trying to import this package in my program. i want to make a function which takes a Text message in argument and returns the SHA256 hash of that message. but i'm not able to build the program . here is my code snipet.
import Array "mo:base/Array";
import Prim "mo:prim";
import Sha256 "./SHA256";
actor {
public func getHash(text : Text) : async [Word8] {
var a: [Word8] = [];
for (c in text.chars()) {
let word: Word8 = Prim.natToWord8(Prim.word32ToNat(Prim.charToWord32(c)));
a := Array.append(a, [word]);
};
return Sha256.sha256(a);
};
};
I Got this Error :
import error [M0009], file "/home/sudesh/Dfinity/check_arg/src/check_arg/SHA256/lib.mo" does not exist
Please let me know if i need to do anything else.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.