Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

divvy-lib-messagesigner

xdv90.1.0

Signs messages

divvy, divvy-lib, divvy-lib-messagesigner

readme

divvy-lib-messagesigner

This module exports a Message class which can sign arbitrary data. To use it you must use the exported class factory, which injects the required divvy-lib and sjcl-extended dependencies.

// import dependencies
var divvylib = require('divvy-lib');
var sjcl = require('sjcl-extended');

// wire it all together
var messageFactory = require('divvy-lib-messagesigner');
var Message = messageFactory(divvylib, sjcl);

// sign a message
var secret = 'safRpB5euNL52PZPTSqrE9gvuFwTC';
var msg = 'goodbye cruel world!';
var signature = Message.signMessage(msg, secret);

console.log(signature);
// AAAAG8rK+Ih6Oxf+kV5pHxjt9QPEaSNBgPUcBbzA9A5mI8ecC8YaWb3fxkUM4TVnI9EeP+JnGMN3BxEuHSmY2VBvy48=