hacks

package
v0.0.0-...-9e28d38 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BStoS

func BStoS(bs []byte) string

BStoS converts a byte slice to a string. WARNING: this should only be used when the byte slice is final. If the byte slice is modified the string may change which is illegal since strings are immutable. This is an optimization (to avoid allocation) that should not be overused.

func Btobs

func Btobs(b byte) []byte

Btobs converts a byte to a byte slice without allocating. WARNING: The resulting byte slice must not be modified or escape.

func CrcUint32

func CrcUint32(crc, n uint32) uint32

func Stobs

func Stobs(s string) []byte

Stobs converts a string to a byte slice without allocating a copy. WARNING: The resulting byte slice must not be modified. If the byte slice is modified the string will change which is illegal since strings are immutable. This is an optimization (to avoid allocation) that should not be overused.

Types

This section is empty.

Jump to

Keyboard shortcuts

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