Expand description
What a binary value holds, told from its first bytes, and the text in it
where that is cheap to get: UTF-8 stored as bytes, or gzip and zstd of text.
Nothing here runs or renders what it finds; decompression stops at
DECODE_MAX bytes of output, whatever the input claims.
Structs§
- Decoded
- Text decoded from bytes: what it came from, and whether it was cut at
DECODE_MAX.
Enums§
- Sniffed
- A kind of content, named from its magic bytes.
Constants§
- DECODE_
MAX - The most text decoded from a value: a decompression bomb stops here.
Functions§
- decode_
text - The text in
bytes: themselves when they are UTF-8, or what gzip or zstd decompress them to, up toDECODE_MAXbytes. None when there is no text. - sniff
- What
byteshold, from the bytes alone. UTF-8 is text that decodes whole and has no NUL in it.