Compress a raw vector using the LZ4 or ZSTD compressor.

compress_fst(x, compressor = "ZSTD", compression = 0, hash = FALSE)

Arguments

x

raw vector.

compressor

compressor to use for compressing x. Valid options are "LZ4" and "ZSTD" (default).

compression

compression factor used. Must be in the range 0 (lowest compression) to 100 (maximum compression).

hash

Compute hash of compressed data. This hash is stored in the resulting raw vector and can be used during decompression to check the validity of the compressed vector. Hash computation is done with the very fast xxHash algorithm and implemented as a parallel operation, so the performance hit will be very small.