Initialize bigint
This commit is contained in:
parent
26faea8d91
commit
84e9d00e1d
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue