From 9757fd20f67a3a7a5fd706602cae39ab8572654a Mon Sep 17 00:00:00 2001 From: Kagami Hiiragi Date: Sat, 3 Jan 2015 03:11:02 +0300 Subject: [PATCH] Typo fixes --- lib/address.js | 6 +++--- lib/struct.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/address.js b/lib/address.js index b704b77..9cf5f50 100644 --- a/lib/address.js +++ b/lib/address.js @@ -223,7 +223,7 @@ Address.fromRandom = function(opts) { // FIXME(Kagami): This function is rather slow in browsers so // generation of ripelen=18 currently is disabled (see `test.js`). It - // should be heavilty profiled to determine the bottleneck. + // should be heavily profiled to determine the bottleneck. // TODO(Kagami): We may want to run this in the web worker to speedup // the search. Currently WebCryptoAPI is not available in Firefox in // web workers (see @@ -239,8 +239,8 @@ Address.fromRandom = function(opts) { (strictripelen && len === ripelen) || (!strictripelen && len <= ripelen && checkripelen(ripelen, version)) ) { - // XXX(Kagami): Do we need to put all these properties or - // compute them manually via ECMA5 getters/setters instead? + // TODO(Kagami): Do we need to put all these properties or compute + // them manually via ECMA5 getters/setters instead? resolve(new Address(Object.assign({ signPrivateKey: signPrivateKey, signPublicKey: signPublicKey, diff --git a/lib/struct.js b/lib/struct.js index 72e1154..82f4082 100644 --- a/lib/struct.js +++ b/lib/struct.js @@ -20,8 +20,8 @@ var var_int = exports.var_int = { * Decoded var_int structure. */ decode: function(buf) { - assert(buf.length > 0, "Empty buffer"); var value, length; + assert(buf.length > 0, "Empty buffer"); switch (buf[0]) { case 253: value = buf.readUInt16BE(1); @@ -38,14 +38,14 @@ var var_int = exports.var_int = { assert(hi !== 0, "Impractical var_int"); // Max safe number = 2^53 - 1 = // 0b0000000000011111111111111111111111111111111111111111111111111111 - // = 2097151*(2^32) + (2^32 - 1) + // = 2097151*(2^32) + (2^32 - 1). // So it's safe until hi <= 2097151. See // , // for details. // TODO(Kagami): We may want to return raw Buffer for - // 2^53 <= value <= 2^64 - 1 range. Possible using the optional - // argument because most of the code expect to get number from - // `var_int.decode`. + // 2^53 <= value <= 2^64 - 1 range. Possibly using the optional + // argument because most of the code expect to get a number when + // calling `var_int.decode`. assert(hi <= 2097151, "Unsafe integer"); var lo = buf.readUInt32BE(5); value = hi * 4294967296 + lo; @@ -86,7 +86,7 @@ var var_int = exports.var_int = { buf.writeUInt32BE(value % 4294967296, 5); // low32 } } else if (Buffer.isBuffer(value)) { - assert(value.length <= 8, "Buffer too big"); + assert(value.length <= 8, "Buffer is too big"); buf = new Buffer(9); buf.fill(0); buf[0] = 255;