strx

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64(n int) string

Base64 generates a random base64 string with length of n.

func Bytes

func Bytes(n int) []byte

Bytes generates n random bytes.

func DecodeBase64 added in v0.1.1

func DecodeBase64(str string) (string, error)

DecodeBase64 decodes the given string, which can accept padded or none padded format.

func DecodeBase64Bytes added in v0.1.1

func DecodeBase64Bytes(src []byte) ([]byte, error)

DecodeBase64Bytes decodes the given bytes.

func EncodeBase64 added in v0.1.1

func EncodeBase64(src string) string

EncodeBase64 encodes the given string, and then output standard format.

func EncodeBase64Bytes added in v0.1.1

func EncodeBase64Bytes(src []byte) []byte

EncodeBase64Bytes is similar to DecodeBase64, but returns bytes.

func FromBytes added in v0.1.1

func FromBytes(bs *[]byte) string

func Hex

func Hex(n int) string

Hex generates a random hex string with length of n e.g: 67aab2d956bd7cc621af22cfb169cba8.

func String

func String(n int, letters ...string) string

String generates a random string using only letters provided in the letters parameter if user omit letters parameters, this function will use defLetters instead.

func Sum

func Sum(ss ...string) string

func ToBytes added in v0.1.1

func ToBytes(s *string) (bs []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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