Shardus Crypto Utils
Shardus Crypto Utils is a tool providing a set of cryptographic utility functions specifically designed for developers working with the Shardus core. It offers a simplified interface to node-sodium cryptographic functions, which are fundamental to the Shardus project.
Installation
You can install Shardus Crypto Utils via npm:
npm install @shardus/crypto-utils
Usage
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)
Here's how you can use Shardus Crypto Utils in your Node.js application:
const crypto = require('shardus-crypto-utils')
crypto.init('64f152869ca2d473e4ba64ab53f49ccdb2edae22da192c126850970e788af347')
let msg = crypto.hash('Hello world!')
console.log(msg)
Release
To release a new version of Shardus Crypto Utils, run the following command:
npm run release
This will handle version bumping, generating release notes, tagging, and publishing to npm.
Contributing
Contributions are very welcome! Everyone interacting in our codebases, issue trackers, and any other form of communication, including chat rooms and mailing lists, is expected to follow our code of conduct so we can all enjoy the effort we put into this project.