Documentation
¶
Overview ¶
Package internal is a collection of common compression algorithms.
For performance reasons, these packages lack strong error checking and require that the caller to ensure that strict invariants are kept.
Index ¶
Constants ¶
const Debug = false
Debug indicates whether the debug build tag was set.
If set, programs may choose to print with more human-readable debug information and also perform sanity checks that would otherwise be too expensive to run in a release build.
const GoFuzz = false
GoFuzz indicates whether the gofuzz build tag was set.
If set, programs may choose to disable certain checks (like checksums) that would be nearly impossible for gofuzz to properly get right. If GoFuzz is set, it implies that Debug is set as well.
Variables ¶
var ( // IdentityLUT returns the input key itself. IdentityLUT = func() (lut [256]byte) { for i := range lut { lut[i] = uint8(i) } return lut }() // ReverseLUT returns the input key with its bits reversed. ReverseLUT = func() (lut [256]byte) { for i := range lut { b := uint8(i) b = (b&0xaa)>>1 | (b&0x55)<<1 b = (b&0xcc)>>2 | (b&0x33)<<2 b = (b&0xf0)>>4 | (b&0x0f)<<4 lut[i] = b } return lut }() )
Functions ¶
func ReverseUint32N ¶
ReverseUint32N reverses the lower n bits of v.
func ReverseUint64N ¶
ReverseUint64N reverses the lower n bits of v.
Types ¶
type MoveToFront ¶
type MoveToFront struct {
// contains filtered or unexported fields
}
MoveToFront is a data structure that allows for more efficient move-to-front transformations. This specific implementation assumes that the alphabet is densely packed within 0..255.
func (*MoveToFront) Decode ¶
func (m *MoveToFront) Decode(idxs []uint8)
func (*MoveToFront) Encode ¶
func (m *MoveToFront) Encode(vals []uint8)
Directories
¶
Path | Synopsis |
---|---|
cgo
|
|
brotli
Package brotli implements the Brotli compressed data format using C wrappers.
|
Package brotli implements the Brotli compressed data format using C wrappers. |
bzip2
Package bzip2 implements the BZip2 compressed data format using C wrappers.
|
Package bzip2 implements the BZip2 compressed data format using C wrappers. |
flate
Package flate implements the DEFLATE compressed data format, described in RFC 1951, using C wrappers.
|
Package flate implements the DEFLATE compressed data format, described in RFC 1951, using C wrappers. |
lzma
Package lzma implements the LZMA2 compressed data format using C wrappers.
|
Package lzma implements the LZMA2 compressed data format using C wrappers. |
zstd
Package zstd implements the Zstandard compressed data format using C wrappers.
|
Package zstd implements the Zstandard compressed data format using C wrappers. |
Package errors implements functions to manipulate compression errors.
|
Package errors implements functions to manipulate compression errors. |
Package prefix implements bit readers and writers that use prefix encoding.
|
Package prefix implements bit readers and writers that use prefix encoding. |
Package testutil is a collection of testing helper methods.
|
Package testutil is a collection of testing helper methods. |
tool
|
|
bench
Benchmark tool to compare performance between multiple compression implementations.
|
Benchmark tool to compare performance between multiple compression implementations. |
bitgen
BitGen to generate a binary from a BitGen formatting input.
|
BitGen to generate a binary from a BitGen formatting input. |