divvy-lib-messagesigner

0.1.0 • Public • Published

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=

Package Sidebar

Install

npm i divvy-lib-messagesigner

Weekly Downloads

4

Version

0.1.0

License

none

Unpacked Size

20.2 kB

Total Files

5

Last publish

Collaborators

  • marlonhanks