Learn R Programming

zstdr (version 0.1.1)

zstdCompress: Zstandard comression

Description

Zstandard, or zstd as short version, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios.

Usage

zstdCompress(data, level = 3)

Arguments

data

input data to be compressed or decomressed

level

compression level to use, value between 1 and returned by zstdMaxCLevel function, default is 3

Value

compressed data

Details

Compresses data using zstandard algorithm

References

http://facebook.github.io/zstd/

See Also

memCompress zstdDecompress zstdMaxCLevel

Examples

Run this code
# Simple example
library(zstdr)
data_file <- file.path(R.home(), "COPYING")
data <- readBin(data_file, raw(), file.info(data_file)$size)
compressed <- zstdCompress(data)
stopifnot(identical(data, zstdDecompress(compressed)))

Run the code above in your browser using DataLab