bytesutil

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package bytesutil provides utility functions for byte slice operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBase64

func FromBase64(base64Str string) ([]byte, error)

FromBase64 decodes a base64-encoded string into a byte slice.

func FromBase64Multi added in v0.0.63

func FromBase64Multi(base64Strs ...string) ([][]byte, error)

FromBase64Multi decodes multiple base64-encoded strings into byte slices.

func FromGobInto added in v0.0.19

func FromGobInto(gobBytes []byte, destPtr any) error

FromGobInto decodes a gob-encoded byte slice into a destination. The destination must be a pointer to the destination type.

func Random

func Random(byteLen int) ([]byte, error)

Random returns a slice of cryptographically random bytes of length byteLen.

func ToBase64

func ToBase64(bytes []byte) string

ToBase64 encodes a byte slice into a base64-encoded string.

func ToBase64Multi added in v0.0.63

func ToBase64Multi(bytes ...[]byte) []string

ToBase64Multi encodes multiple byte slices into base64-encoded strings.

func ToGob added in v0.0.19

func ToGob(src any) ([]byte, error)

ToGob encodes an arbitrary value into a gob-encoded byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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