compressed and returns exactly expectedSize bytes.
crypt.lz4compress to learn more.expectedSize is the length of the original plaintext in bytes, not the length of the compressed input - you have to track and pass it yourself.
There is no integrity check - if the bytes are damaged or expectedSize is wrong, the function still returns a string of that length without raising an error.
Parameters
Returns
string - the decompressed bytes, padded or truncated to exactly expectedSize characters. When
expectedSize matches the original length, the result is the full plaintext.
Aliases
lz4decompress
Example
In a chat-event-based Roblox game, stream Bad Apple as ASCII video over a remote at 30fps.Reason: storing >1800 frames and parsing them would be a lot more easier if you compress the data beforehand.