encoding: fix typo for BN.
This commit is contained in:
parent
f2a9eb6538
commit
ba88ffab01
@ -582,7 +582,7 @@ encoding.readVarintBN = function readVarintBN(data, off) {
|
|||||||
case 0xff:
|
case 0xff:
|
||||||
size = 9;
|
size = 9;
|
||||||
assert(off + size <= data.length);
|
assert(off + size <= data.length);
|
||||||
value = encoding.readU64(data, off + 1);
|
value = encoding.readU64BN(data, off + 1);
|
||||||
assert(value.bitLength() > 32);
|
assert(value.bitLength() > 32);
|
||||||
return new Varint(size, value);
|
return new Varint(size, value);
|
||||||
default:
|
default:
|
||||||
@ -601,7 +601,7 @@ encoding.readVarintBN = function readVarintBN(data, off) {
|
|||||||
encoding.writeVarintBN = function writeVarintBN(dst, num, off) {
|
encoding.writeVarintBN = function writeVarintBN(dst, num, off) {
|
||||||
if (num.bitLength() > 32) {
|
if (num.bitLength() > 32) {
|
||||||
dst[off] = 0xff;
|
dst[off] = 0xff;
|
||||||
encoding.writeU64(dst, num, off + 1);
|
encoding.writeU64BN(dst, num, off + 1);
|
||||||
return off + 9;
|
return off + 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user