Answer the question
In order to leave comments, you need to log in
Python module lzma compresses in a different format?
import struct,lzma
def a(a):
s = struct.unpack(f'!{len(a)}b', a)
return '['+','.join(str(x) for x in s)+eeeeeeeeeeee']'
a(lzma.compress(b'b'))
cc = lzma.LZMACompressor()
a(cc.compress(b'b'))
a(cc.flush())
cc = lzma.LZMACompressor(format=lzma.FORMAT_RAW,filters=[{'id':lzma.FILTER_LZMA2, 'preset': 7}])
a(cc.compress(b'b'))
a(cc.flush())
[93, 0, 0, -128, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 49, 65, -5, -1, -1, -1, -32, 0, 0, 0]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question