silk.compress.brotli_tables.
The static dictionary, word transforms, and literal context lookup table of Brotli (RFC 7932).
When to use#
Use silk.compress.brotli to decode Brotli. Use this module only to read the raw tables, for
example in a custom Brotli encoder.
Details#
The tables are static byte strings and arrays. The lookups do not allocate.
Public declarations: 10.
transformCount#
pub fn transformCount() -> usizeThe number of word transforms, 121.
words#
pub fn words() -> &'static [u8]Returns the 122,784 bytes of the static dictionary: for each word length from 4 to 24, all words of that length, one after another.
wordSizeBits#
pub fn wordSizeBits(length: usize) -> u32Returns the base-2 logarithm of the number of dictionary words of length bytes, or 0 when
there are none (lengths below 4 or above 24).
wordOffset#
pub fn wordOffset(length: usize) -> usizeReturns where the words of length bytes start in words, for lengths from 4 to 24.
affixes#
pub fn affixes() -> &'static [u8]Returns the prefixes and suffixes of the word transforms. Each one is a length byte followed by its bytes.
affixOffset#
pub fn affixOffset(index: usize) -> usizeReturns where affix index (0 to 49) starts in affixes.
transformPrefix#
pub fn transformPrefix(index: usize) -> usizeReturns the prefix affix index of transform index (0 to 120).
transformKind#
pub fn transformKind(index: usize) -> u32Returns the kind of transform index: 0 for identity, 1 to 9 to drop that many last bytes, 10
to uppercase the first character, 11 to uppercase all, and 12 to 20 to drop 1 to 9 first bytes.
transformSuffix#
pub fn transformSuffix(index: usize) -> usizeReturns the suffix affix index of transform index (0 to 120).
contextLookup#
pub fn contextLookup() -> &'static [u8]Returns the context lookup table: for context mode m, the context of a literal after bytes
p1 (last) and p2 is table[m * 512 + p1] | table[m * 512 + 256 + p2].
Category: Data formats.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.