I have a program that is supposed to compress some data with LZMA, but it returns an empty string.
# this is as much as I can isolate it. For full code, visit https://replit.com/@inyourface3445/Text-Viewer-from-Bsace-64-URL#test.py
import lzma
zlib = lzma.LZMACompressor(preset = 9)
zlib_dc = lzma.LZMADecompressor()
txt = 'hello'
compressed_text = zlib.compress(txt.encode())
b64 = compressed_text
print(b64.decode('utf-16'))
s2 = zlib_dc.decompress(b64).decode()
print(len(s2))
The output looks like this:
㟽塺ZЀ훦䚴ġ켐챘
0
The first line is the raw compressed data, and the second line is the length of the output of the algorithem.