Initialize bigint
This commit is contained in:
parent
26faea8d91
commit
84e9d00e1d
|
@ -188,7 +188,7 @@ proc concat(result: var string; prs: Preserve) =
|
||||||
of pkByteString:
|
of pkByteString:
|
||||||
for b in prs.bytes:
|
for b in prs.bytes:
|
||||||
if b.char notin {'\20'..'\21', '#'..'[', ']'..'~'}:
|
if b.char notin {'\20'..'\21', '#'..'[', ']'..'~'}:
|
||||||
result.add("#[")
|
result.add("#[") #]#
|
||||||
result.add(base64.encode(prs.bytes))
|
result.add(base64.encode(prs.bytes))
|
||||||
result.add(']')
|
result.add(']')
|
||||||
return
|
return
|
||||||
|
@ -459,7 +459,7 @@ proc decodePreserves*(s: Stream): Preserve =
|
||||||
discard s.readUint8()
|
discard s.readUint8()
|
||||||
of 0xb0:
|
of 0xb0:
|
||||||
let len = s.readVarint()
|
let len = s.readVarint()
|
||||||
result = Preserve(kind: pkBigInteger)
|
result = Preserve(kind: pkBigInteger, bigint: initBigint 0)
|
||||||
for _ in 1..len:
|
for _ in 1..len:
|
||||||
result.bigint = (result.bigint shl 8) + s.readUint8().int32
|
result.bigint = (result.bigint shl 8) + s.readUint8().int32
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue