| komp_codecs | R Documentation |
Every codec this build of zukomp knows the name of, whether or not an implementation is present, plus any codec registered by another package. This is the R-visible face of the registry: it is how you discover what can be compressed, at what levels, and which HTTP content-coding each codec corresponds to.
komp_codecs()
Built in are identity, the DEFLATE family (deflate-raw, zlib,
gzip), zstd, and LZ4 as two codecs: lz4-frame, the self-describing
frame format, and lz4-block, one bare block with no header.
A codec that is declared but not installed still gets a row, with
available = FALSE and NA for everything capability-shaped. That is
deliberate: "brotli is a codec zukomp knows, with no implementation here"
is a more useful answer than pretending the codec does not exist.
A data frame with one row per codec and the columns:
Codec name, as accepted by the codec argument elsewhere.
Is an implementation registered?
Supported directions; NA if unavailable.
Codec-native compression
levels. NA when the codec has no level axis, and when it is
unavailable. Levels are not comparable between codecs.
Where the abstract levels "fast" and
"best" land for this codec. These are not level_min and
level_max: for the DEFLATE family level 0 is stored blocks, so
"fast" is 1, and a codec whose level is an acceleration factor
inverts the mapping entirely. Only the codec knows, so it declares
them.
Can komp_detect() recognise this codec from its
bytes? Headerless formats cannot be detected and must be named.
Does the codec support a mid-stream flush – "put the
bytes on the wire now"? NA if unavailable. A caller streaming a
request body should check this before committing to a codec, rather
than discovering it mid-body.
The HTTP content-coding token, or NA.
Package that registered the implementation, or NA.
The built-in codecs implement the formats specified in Deutsch, P. (1996) "DEFLATE Compressed Data Format Specification version 1.3", RFC 1951, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.17487/RFC1951")}; Deutsch, P. and Gailly, J-L. (1996) "ZLIB Compressed Data Format Specification version 3.3", RFC 1950, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.17487/RFC1950")}; Deutsch, P. (1996) "GZIP file format specification version 4.3", RFC 1952, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.17487/RFC1952")}; Collet, Y. and Kucherawy, M. (2021) "Zstandard Compression and the 'application/zstd' Media Type", RFC 8878, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.17487/RFC8878")}; and the LZ4 frame and block format descriptions, https://github.com/lz4/lz4/tree/dev/doc.
codecs <- komp_codecs()
codecs[, c("id", "available", "content_encoding")]
# what this build can actually decompress right now
codecs$id[which(codecs$can_decode)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.