VarInt now uses correct prefix for 64-bit

This commit is contained in:
Daniel Cousens 2014-03-25 17:23:01 +11:00
parent a74c878b59
commit 164d31ee3d

View file

@ -131,7 +131,7 @@ function numToVarInt(num) {
if (num < 253) return [num]; if (num < 253) return [num];
if (num < 65536) return [253].concat(numToBytes(num, 2)); if (num < 65536) return [253].concat(numToBytes(num, 2));
if (num < 4294967296) return [254].concat(numToBytes(num, 4)); if (num < 4294967296) return [254].concat(numToBytes(num, 4));
return [253].concat(numToBytes(num, 8)); return [255].concat(numToBytes(num, 8));
} }
function bytesToWords(bytes) { function bytesToWords(bytes) {