From 69c8ca7e9c9113be8ff35a4c541843ed46ee06ff Mon Sep 17 00:00:00 2001 From: Brian 2 Hammond Date: Mon, 19 Oct 2015 12:46:39 -0400 Subject: [PATCH] pad octet array to the left to avoid weirdness with values >= 2^23 --- lib/protocol/uint64_t.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/protocol/uint64_t.js b/lib/protocol/uint64_t.js index 2be9664..98aa293 100644 --- a/lib/protocol/uint64_t.js +++ b/lib/protocol/uint64_t.js @@ -350,6 +350,8 @@ uint64_t.prototype.toOctets = function uint64_t_toOctets() { v.hi >>>= 8; } + while (a.length<8) a.unshift(0); + return (a); };