1.0.7 • Published 6 years ago

rpgcore-message v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

RPGcoin Message Verification and Signing for RPGcore

rpgcore-message adds support for verifying and signing rpgcoin messages in Node.js and web browsers.

See the main rpgcore repo for more information.

Getting Started

npm install rpgcore-message
bower install rpgcore-message

To sign a message:

var rpgcore = require('rpgcore-lib');
var Message = require('rpgcore-message');

var privateKey = rpgcore.PrivateKey.fromWIF('5K2DxqJ9kLFL3hF3KEWDftAig3TyAXenDxpr27PaLBieuSFo5PQ');
var signature = Message('hello, world').sign(privateKey);

To verify a message:

var address = 'RGRsG7UQc3AmvdrhPDngpPjvTNhJQFeHYj';
var signature = 'G5cFMHRysjcxkBJ7mol8l3cjPbFQFQ68fNqTGehTO9/cLNUaflt3gQT//yAUp5fqWF0snDlZYkXJoooazBicRTg=';
var verified = Message('hello, world').verify(address, signature);

Contributing

See CONTRIBUTING.md on the main rpgcore repo for information about how to contribute.

License

Code released under the MIT license.