Start to implement node wrapper
This commit is contained in:
parent
1ccc88dd97
commit
bade7b61fa
3
index.js
3
index.js
|
@ -0,0 +1,3 @@
|
|||
var secp256k1 = require("secp256k1");
|
||||
|
||||
exports.getPublic = secp256k1.createPublicKey.bind(null);
|
|
@ -5,7 +5,7 @@
|
|||
"main": "index.js",
|
||||
"browser": "browser.js",
|
||||
"scripts": {
|
||||
"test": "mocha && xvfb-run -a karma start && jshint .",
|
||||
"test": "mocha && jshint .",
|
||||
"m": "mocha",
|
||||
"k": "xvfb-run -a karma start",
|
||||
"kc": "xvfb-run -a karma start --browsers Chromium",
|
||||
|
@ -44,5 +44,8 @@
|
|||
"karma-mocha": "^0.1.10",
|
||||
"karma-mocha-reporter": "^0.3.1",
|
||||
"mocha": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"secp256k1": "~0.0.13"
|
||||
}
|
||||
}
|
||||
|
|
8
test.js
8
test.js
|
@ -1,6 +1,10 @@
|
|||
var expect = require("chai").expect;
|
||||
var eccrypto = require("./");
|
||||
|
||||
describe("test", function() {
|
||||
it("just test", function() {
|
||||
describe("Key", function() {
|
||||
it("should allow to convert private key to public", function() {
|
||||
var privateKey = Buffer(32);
|
||||
privateKey.fill(1);
|
||||
expect(eccrypto.getPublic(privateKey).toString("hex")).to.equal("041b84c5567b126440995d3ed5aaba0565d71e1834604819ff9c17f5e9d5dd078f70beaf8f588b541507fed6a642c5ab42dfdf8120a7f639de5122d47a69a8e8d1");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user