From a94a2a101d00d41e804b64b0cb1517dba43283bd Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 19 May 2016 19:32:08 -0700 Subject: [PATCH] fix big endian 64 bit ints. --- lib/bcoin/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bcoin/utils.js b/lib/bcoin/utils.js index 375b8239..f6216edc 100644 --- a/lib/bcoin/utils.js +++ b/lib/bcoin/utils.js @@ -1523,8 +1523,8 @@ utils.readU64N = function readU64N(data, off, force53, be) { off = off >>> 0; if (be) { - hi = data.readUInt32LE(off, true); - lo = data.readUInt32LE(off + 4, true); + hi = data.readUInt32BE(off, true); + lo = data.readUInt32BE(off + 4, true); } else { hi = data.readUInt32LE(off + 4, true); lo = data.readUInt32LE(off, true); @@ -1566,8 +1566,8 @@ utils.read64N = function read64N(data, off, force53, be) { off = off >>> 0; if (be) { - hi = data.readUInt32LE(off, true); - lo = data.readUInt32LE(off + 4, true); + hi = data.readUInt32BE(off, true); + lo = data.readUInt32BE(off + 4, true); } else { hi = data.readUInt32LE(off + 4, true); lo = data.readUInt32LE(off, true);