bytes

package
v0.0.0-...-093b764 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(b []byte) []byte

Copy returns a copy of byte slice in a new pointer.

func Equal

func Equal(a, b []byte) bool

Equal reports whether a and b are the same length and contain the same bytes. A nil argument is equivalent to an empty slice.

func Extend

func Extend(b []byte, needLen int) []byte

Extend extends b to needLen bytes.

func Prepend

func Prepend(dst []byte, src ...byte) []byte

Prepend prepends bytes into a given byte slice.

func PrependString

func PrependString(dst []byte, src string) []byte

PrependString prepends a string into a given byte slice.

func Rand

func Rand(dst []byte) []byte

Rand returns dst with a cryptographically secure string random bytes.

NOTE: Make sure that dst has the length you need.

Types

This section is empty.

Jump to

Keyboard shortcuts

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