Newton's Principia Mathematica

    @arcblock/mcrypto
    TypeScript icon, indicating that this package has built-in type declarations

    1.6.3 • Public • Published

    mcrypto:js

    styled with prettier docs Gitter

    Forge mcrypto implementation for javascript, just a wrapper around existing javascript crypto libraries.

    Usage

    npm i @arcblock/mcrypto -S
    # OR
    yarn add @arcblock/mcrypto

    Sign/Verify

    const { Signer } = require('@arcblock/mcrypto');
    
    const keyPair = Signer.Ed25519.genKeyPair();
    const message = 'some message to sign';
    const signature = Signer.Ed25519.sign(message, keyPair.secretKey);
    const result = Signer.Ed25519.verify(message, signature, keyPair.publicKey);
    assert.ok(result);

    Hashing

    const { Hasher } = require('@arcblock/mcrypto');
    
    const message = 'message to hash';
    const hash = Hasher.SHA2.hash256(message);

    Documentation

    For full documentation, checkout https://forge-js.netlify.com

    Implementation

    Hasher

    • keccakf1600: js-sha3
    • sha2: hash.js
    • sha3: js-sha3

    Signer

    • ed25519: tweetnacl
    • secp256k1: elliptic

    Crypter

    • aes-cbc-256: crypto-js

    Install

    npm i @arcblock/mcrypto

    DownloadsWeekly Downloads

    118

    Version

    1.6.3

    License

    Apache-2.0

    Unpacked Size

    25.9 kB

    Total Files

    16

    Last publish

    Collaborators

    • wangshijun
    • polunzh
    • mave99a
    • gxw