zlib_compress_to_base64_string()

Performs zlib compression and encodes the result to base64.

Note

The only supported windows size is 15.

Syntax

zlib_compress_to_base64_string(string)

Learn more about syntax conventions.

Parameters

Name Type Required Description
string string ✔️ The string to be compressed and base64 encoded.

Returns

  • Returns a string that represents zlib-compressed and base64-encoded original string.
  • Returns an empty result if compression or encoding failed.

Example

Using Kusto Query Language

print zcomp = zlib_compress_to_base64_string("1234567890qwertyuiop")

Output

zcomp
"eAEBFADr/zEyMzQ1Njc4OTBxd2VydHl1aW9wOAkGdw=="

Using Python

Compression can be done using other tools, for example Python.

print(base64.b64encode(zlib.compress(b'<original_string>')))