From 7650b354821e0992f72b98fe088daae811876b4c Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Thu, 20 Nov 2014 12:18:08 -0300 Subject: [PATCH] use strict to extras --- lib/extra/identity.js | 6 ++++-- lib/extra/message.js | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/extra/identity.js b/lib/extra/identity.js index 662044d..53116db 100644 --- a/lib/extra/identity.js +++ b/lib/extra/identity.js @@ -1,6 +1,8 @@ -var base58check = require('./base58check'); +'use strict'; + +var base58check = require('../protocol/base58check'); var constants = require('./constants'); -var Hash = require('./hash'); +var Hash = require('../crypto/hash'); /** diff --git a/lib/extra/message.js b/lib/extra/message.js index 1a32f0b..59864ec 100644 --- a/lib/extra/message.js +++ b/lib/extra/message.js @@ -1,9 +1,11 @@ +'use strict'; + var ECDSA = require('./ecdsa'); -var Keypair = require('./keypair'); -var BufferWriter = require('./bufferwriter'); -var Hash = require('./hash'); -var Address = require('./address'); -var Signature = require('./signature'); +var Keypair = require('../keypair'); +var BufferWriter = require('../protocol/bufferwriter'); +var Hash = require('../crypto/hash'); +var Address = require('../address'); +var Signature = require('../signature'); var Message = function Message(obj) { if (!(this instanceof Message)) @@ -39,7 +41,10 @@ Message.magicHash = function(messagebuf) { }; Message.sign = function(messagebuf, keypair) { - var m = Message({messagebuf: messagebuf, keypair: keypair}); + var m = Message({ + messagebuf: messagebuf, + keypair: keypair + }); m.sign(); var sigbuf = m.sig.toCompact(); var sigstr = sigbuf.toString('base64'); @@ -58,7 +63,10 @@ Message.verify = function(messagebuf, sigstr, address) { Message.prototype.sign = function() { var hashbuf = Message.magicHash(this.messagebuf); - var ecdsa = ECDSA({hashbuf: hashbuf, keypair: this.keypair}); + var ecdsa = ECDSA({ + hashbuf: hashbuf, + keypair: this.keypair + }); ecdsa.signRandomK(); ecdsa.calci(); this.sig = ecdsa.sig;