0.0.8 • Published 5 years ago

@owstack/message-lib v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

MessageLib

NPM Package Build Status Coverage Status

Adds support for verifying and signing messages in Node.js and web browsers.

Getting Started

npm install @owstack/message-lib

Example

To sign a message:

const {PrivateKey} = require('@owstack/key-lib');
const Message = require('@owstack/message-lib');

const privateKey = PrivateKey.fromWIF('cPBn5A4ikZvBTQ8D7NnvHZYCAxzDZ5Z2TSGW2LkyPiLxqYaJPBW4');
const signature = new Message('hello, world', 'btc').sign(privateKey);

To verify a message:

const Message = require('@owstack/message-lib');

const address = 'n1ZCYg9YXtB5XCZazLxSmPDa8iwJRZHhGx';
const signature = 'H/DIn8uA1scAuKLlCx+/9LnAcJtwQQ0PmcPrJUq90aboLv3fH5fFvY+vmbfOSFEtGarznYli6ShPr9RXwY9UrIY=';
const verified = new Message('hello, world', 'btc').verify(address, signature);

License

Code released under the MIT license.

Copyright 2019 Open Wallet Stack.

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago