go-ethereum: github.com/axiomzen/go-ethereum/common/bitutil Index | Files

package bitutil

import "github.com/axiomzen/go-ethereum/common/bitutil"

Package bitutil implements fast bitwise operations.

Index

Package Files

bitutil.go compress.go

func ANDBytes Uses

func ANDBytes(dst, a, b []byte) int

ANDBytes ands the bytes in a and b. The destination is assumed to have enough space. Returns the number of bytes and'd.

func CompressBytes Uses

func CompressBytes(data []byte) []byte

CompressBytes compresses the input byte slice according to the sparse bitset representation algorithm. If the result is bigger than the original input, no compression is done.

func DecompressBytes Uses

func DecompressBytes(data []byte, target int) ([]byte, error)

DecompressBytes decompresses data with a known target size. If the input data matches the size of the target, it means no compression was done in the first place.

func ORBytes Uses

func ORBytes(dst, a, b []byte) int

ORBytes ors the bytes in a and b. The destination is assumed to have enough space. Returns the number of bytes or'd.

func TestBytes Uses

func TestBytes(p []byte) bool

TestBytes tests whether any bit is set in the input byte slice.

func XORBytes Uses

func XORBytes(dst, a, b []byte) int

XORBytes xors the bytes in a and b. The destination is assumed to have enough space. Returns the number of bytes xor'd.

Package bitutil imports 3 packages (graph). Updated 2019-07-06. Refresh now. Tools for package owners.