Add a helper for one-shot framing-format decompression

This commit is contained in:
Zahary Karadjov 2020-04-16 14:59:42 +03:00
parent 80cff583e3
commit b1726ab7e7
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ proc framing_format_uncompress*(input: InputStream, output: OutputStream) =
output.flush() output.flush()
proc framingFormatUncompress*(input: openarray[byte]): seq[byte] =
var output = memoryOutput()
framing_format_uncompress memoryInput(input), output
return output.getOutput
proc processFrame*(output: OutputStream, dst: var openArray[byte], src: openArray[byte]) = proc processFrame*(output: OutputStream, dst: var openArray[byte], src: openArray[byte]) =
let let
crc = masked_crc32c(src[0].unsafeAddr, src.len.uint) crc = masked_crc32c(src[0].unsafeAddr, src.len.uint)