Initialize bigint

This commit is contained in:
Emery Hemingway 2021-08-10 01:41:18 +02:00
parent 26faea8d91
commit 84e9d00e1d
1 changed files with 2 additions and 2 deletions

View File

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