shardus-crypto-utils
Provides a simple interface to node-sodium cryptographic functions, as used by the Shardus project.
const crypto = require('shardus-crypto-utils')
crypto.init('64f152869ca2d473e4ba64ab53f49ccdb2edae22da192c126850970e788af347')
crypto.stringify(obj)
crypto.randomBytes([bytes])
crypto.hash(input [, fmt])
crypto.hashObj(obj [, removeSign])
crypto.generateKeypair()
crypto.sign(input, sk)
crypto.signObj(obj, sk, pk)
crypto.verify(input, sig, pk)
crypto.verifyObj(obj)
Install
npm install @shardus/crypto-utils
Use
const crypto = require('shardus-crypto-utils')
crypto.init('64f152869ca2d473e4ba64ab53f49ccdb2edae22da192c126850970e788af347')
let msg = crypto.hash('Hello world!')
console.log(msg)
Release
For your releasing pleasure, oh shardus Maintainer, please run the command
npm run release