utils

package
v0.0.0-...-b078ee1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignTo

func AlignTo(val, align uint64) uint64

func AllZeros

func AllZeros(bs []byte) bool

func Assert

func Assert(condition bool)

func Bit

func Bit[T Uint](val T, pos int) T

func BitCeil

func BitCeil(val uint64) uint64

func Bits

func Bits[T Uint](val T, hi T, lo T) T

func Fatal

func Fatal(v any)

func MustNo

func MustNo(err error)

func Read

func Read[T any](data []byte) (val T)

func ReadSlice

func ReadSlice[T any](data []byte, sz int) []T

func RemoveIf

func RemoveIf[T any](elems []T, condition func(T) bool) []T

func RemovePrefix

func RemovePrefix(s, prefix string) (string, bool)

func SignExtend

func SignExtend(val uint64, size int) uint64

func Write

func Write[T any](data []byte, e T)

Types

type Uint

type Uint interface {
	uint8 | uint16 | uint32 | uint64
}

Jump to

Keyboard shortcuts

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