utils

package
v0.0.0-...-c85336e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBit

func GetBit[T constraints.Unsigned, U constraints.Integer](v T, n U) T

func IsAdmin

func IsAdmin(message string) bool

IsAdmin when given a string of the form: key1=value1;key2=value2;... returns true if the first "admin" key is "true".

func NewBitBuffer

func NewBitBuffer(buf []byte) *bitBuffer

func NewEmptyBitBuffer

func NewEmptyBitBuffer(capacity int) *bitBuffer

func PanicOnErr

func PanicOnErr(err error)

PanicOnErr panics if err is set

func PrintTitle

func PrintTitle(set, challenge int)

PrintTitle prints the set and challenge using ansi colors

func Remaining

func Remaining(n, m int) int

Remaining returns the smallest non-negative x such that (n+x)%m equals 0.

func RotateLeft

func RotateLeft(v uint32, n int) uint32

func RotateRight

func RotateRight(v uint32, n int) uint32

func SetBit

func SetBit[T constraints.Unsigned, U constraints.Integer](a T, n U, v T) T

func Xor

func Xor(buf1, buf2 []byte) []byte

Xor returns new buffer with content set to buf1 xor buf2

Types

This section is empty.

Jump to

Keyboard shortcuts

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