package bitutil
import "github.com/ethereum/go-ethereum/common/bitutil"
Package bitutil implements fast bitwise operations.
Index ¶
- func ANDBytes(dst, a, b []byte) int
- func CompressBytes(data []byte) []byte
- func DecompressBytes(data []byte, target int) ([]byte, error)
- func ORBytes(dst, a, b []byte) int
- func TestBytes(p []byte) bool
- func XORBytes(dst, a, b []byte) int
Functions ¶
func ANDBytes ¶
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 ¶
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 ¶
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 ¶
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 ¶
TestBytes tests whether any bit is set in the input byte slice.
func XORBytes ¶
XORBytes xors the bytes in a and b. The destination is assumed to have enough space. Returns the number of bytes xor'd.
Source Files ¶
- Version
- v1.15.11 (latest)
- Published
- May 5, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 day ago –
Tools for package owners.