Fun fact:
When you pass a string to buffer.fromstring()
, the string will automatically be compressed with ZSTD compression! You can theoretically pass the buffer object to HttpService:JSONEncode()
, it would give you that compressed string encoded in zbase64 (or normal base64 in short strings) and it would be possible to get the raw ZSTD compressed string by just decoding the zbase64. You could also reverse that process by encoding the compressed string in zbase64, reconstructing the JSON and passing it to HttpService:JSONDecode()
, and that should give you a buffer object which you can use buffer.tostring()
on, and you would have the decompressed string.