From 8f6140109963833d3bce21565384af62fa7cab70 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 4 Mar 2014 03:23:42 -0300 Subject: [PATCH] add support for Sign and Verify in Key for Browser. Tests added --- Key.js | 58 +++++++++++++++++++++++++++++++++++++++++++----- test/test.Key.js | 32 ++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/Key.js b/Key.js index 80187b550..21f5086e9 100644 --- a/Key.js +++ b/Key.js @@ -1,6 +1,5 @@ - if (process.versions) { // c++ native version module.exports = require('bindings')('KeyModule'); @@ -8,6 +7,18 @@ if (process.versions) { // pure js version var ECKey = require('./browser/bitcoinjs-lib.js').ECKey; var buffertools = require('buffertools'); + + var bufferToArray = function(buffer) { + var ret = []; + + var l = buffer.length; + for(var i =0; i