Clean up formatting of BIP32key (jshint)

This commit is contained in:
Andreas Brekken 2014-01-10 16:09:59 +07:00
parent 49513684a2
commit d39567c589

View file

@ -7,7 +7,7 @@ var util = require('./util'),
var BIP32key = function(opts) {
if (!opts) opts = {}
if (typeof opts == "string") {
if (typeof opts == 'string') {
try {
opts = BIP32key.deserialize(opts);
}
@ -34,8 +34,8 @@ BIP32key.deserialize = function(str) {
back = bytes.slice(bytes.length-4);
var checksum = Crypto.SHA256(Crypto.SHA256(front,{asBytes: true}), {asBytes: true})
.slice(0,4);
if (""+checksum != ""+back) {
throw new Error("Checksum failed");
if ('' + checksum != '' + back) {
throw new Error('Checksum failed');
}
var type = conv.bytesToString(bytes.slice(0,4)) == PRIVDERIV ? 'priv' : 'pub';
return new BIP32key({
@ -116,7 +116,7 @@ BIP32key.prototype.privtopub = BIP32key.prototype.getPub = function() {
}
BIP32key.fromMasterKey = function(seed) {
var I = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA512,seed,"Bitcoin seed",{ asBytes: true })
var I = Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA512,seed, 'Bitcoin seed' , { asBytes: true })
return new BIP32key({
vbytes: conv.stringToBytes(PRIVDERIV),
type: 'priv',