Documentation
¶
Index ¶
- Variables
- func DecodeInt32(input []byte, count int, opts *DecodeOptions[int32]) []int32
- func DecodeUint32(input []byte, count int, opts *DecodeOptions[uint32]) []uint32
- func DeltaDecodeInt32(input []byte, count int, opts *DecodeOptions[int32]) []int32
- func DeltaDecodeUint32(input []byte, count int, opts *DecodeOptions[uint32]) []uint32
- func DeltaEncodeInt32(input []int32, opts *EncodeOptions[int32]) []byte
- func DeltaEncodeUint32(input []uint32, opts *EncodeOptions[uint32]) []byte
- func EncodeInt32(input []int32, opts *EncodeOptions[int32]) []byte
- func EncodeUint32(input []uint32, opts *EncodeOptions[uint32]) []byte
- func MaxEncodedLen(n int) int
- type DecodeOptions
- type EncodeOptions
- type Scheme
Constants ¶
This section is empty.
Variables ¶
View Source
var ZigZag = zigZag{}
Functions ¶
func DecodeInt32 ¶ added in v0.3.0
func DecodeInt32(input []byte, count int, opts *DecodeOptions[int32]) []int32
func DecodeUint32 ¶ added in v0.3.0
func DecodeUint32(input []byte, count int, opts *DecodeOptions[uint32]) []uint32
func DeltaDecodeInt32 ¶ added in v0.3.0
func DeltaDecodeInt32(input []byte, count int, opts *DecodeOptions[int32]) []int32
func DeltaDecodeUint32 ¶ added in v0.3.0
func DeltaDecodeUint32(input []byte, count int, opts *DecodeOptions[uint32]) []uint32
func DeltaEncodeInt32 ¶ added in v0.3.0
func DeltaEncodeInt32(input []int32, opts *EncodeOptions[int32]) []byte
func DeltaEncodeUint32 ¶ added in v0.3.0
func DeltaEncodeUint32(input []uint32, opts *EncodeOptions[uint32]) []byte
func EncodeInt32 ¶ added in v0.3.0
func EncodeInt32(input []int32, opts *EncodeOptions[int32]) []byte
func EncodeUint32 ¶ added in v0.3.0
func EncodeUint32(input []uint32, opts *EncodeOptions[uint32]) []byte
func MaxEncodedLen ¶
MaxEncodedLen returns the maximum number of bytes required to encode n uint32 values.
Types ¶
type DecodeOptions ¶ added in v0.3.0
type EncodeOptions ¶ added in v0.3.0
type Scheme ¶ added in v0.3.0
type Scheme byte
const ( // Scheme1234 is the standard streamvbyte encoding, which encodes the data using 1, 2, 3 or 4 bytes // (plus 2 control bits for each number). Scheme1234 Scheme = 0 // Scheme0124 optimizes for data containing lots of zeros, encoding the data using 0, 1, 2 or 4 bytes. // This means zeroes are only represented in the control bits, and do not add to the data bytes. // As an example, a slice of 1000 zeroes would be encoded in 1250 bytes with standard encoding, but only // 250 bytes with this scheme. However, this optimization comes at the cost of using 4 bytes // even for numbers that would fit into 3 bytes. Scheme0124 Scheme = 1 )
Click to show internal directories.
Click to hide internal directories.