Skip to content

Compression API

Nenkai edited this page Jul 14, 2024 · 2 revisions

Deflate (Compress)

var blob = pdistd::MBlob(data);
var compressed = pdistd::Deflate(blob);

// It is good practice to then encode it into a string
var encoded = pdistd::EncodeBase64(compressed);

Inflate (Decompress)

// var data = pdistd::DecodeBase64(str);

var blob = pdistd::MBlob(data);
var decompressed = pdistd::Inflate(blob);

Deflate/Encrypt Async

var worker = pdistd::DeflateEncryptAsync(path, false);
while (!worker.done)
    yield;

if (worker.result)
{
   // ..
}
Clone this wiki locally