itkwasm_compress_stringify.compress_stringify

Module Contents

Functions

compress_stringify

Given a binary, compress and optionally base64 encode.

API

itkwasm_compress_stringify.compress_stringify.compress_stringify(input: bytes, stringify: bool = False, compression_level: int = 3, data_url_prefix: str = 'data:application/zstd;base64,') bytes

Given a binary, compress and optionally base64 encode.

Parameters:
  • input (bytes) – Input binary

  • stringify (bool) – Stringify the output

  • compression_level (int) – Compression level, typically 1-9

  • data_url_prefix (str) – dataURL prefix

Returns:

Output compressed binary

Return type:

bytes