bytesutil

package
v1.11.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 3 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone added in v1.3.7

func Clone(b []byte) []byte

Clone returns a copy of b.

func CloneSlice added in v1.3.7

func CloneSlice(a [][]byte) [][]byte

CloneSlice returns a copy of a slice of byte slices.

func Contains added in v1.3.9

func Contains(a [][]byte, x []byte) bool

Contains returns true if x is an element of the sorted slice a.

func Intersect

func Intersect(a, b [][]byte) [][]byte

Intersect returns the intersection of a & b in sorted order.

func IsSorted

func IsSorted(a [][]byte) bool

func Pack added in v1.5.0

func Pack(a []byte, width int, val byte) []byte

Pack converts a sparse array to a dense one. It removes sections of a containing runs of val of length width. The returned value is a subslice of a.

func SearchBytes

func SearchBytes(a [][]byte, x []byte) int

SearchBytes performs a binary search for x in the sorted slice a.

func SearchBytesFixed added in v1.4.0

func SearchBytesFixed(a []byte, sz int, fn func(x []byte) bool) int

SearchBytesFixed searches a for x using a binary search. The size of a must be a multiple of of x or else the function panics. There returned value is the index within a where x should exist. The caller should ensure that x does exist at this index.

func Sort

func Sort(a [][]byte)

Sort sorts a slice of byte slices.

func SortDedup added in v1.3.9

func SortDedup(a [][]byte) [][]byte

SortDedup sorts the byte slice a and removes duplicates. The ret

func Union

func Union(a, b [][]byte) [][]byte

Union returns the union of a & b in sorted order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL