GithubHelp home page GithubHelp logo

enzoh / motoko-sha Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 8.0 42 KB

The SHA Package

Home Page: https://sdk.dfinity.org

License: Apache License 2.0

Modelica 95.03% Shell 1.05% Makefile 2.16% Dhall 1.77%

motoko-sha's Introduction

The SHA Package

Build Status

This package implements secure hash algorithms for the Motoko programming language.

Usage

Calculate a SHA256 hash.

public func sha256(data : [Nat8]) : [Nat8]

motoko-sha's People

Contributors

enzoh avatar lavode avatar matthewhammer avatar nomeata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

motoko-sha's Issues

"SHA256/lib.mo" does not exist

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.