rand

package
v1.1.20 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DigitCharacters     = "0123456789"
	LowercaseCharacters = "abcdefghijklmnopqrstuvwxyz"
	UppercaseCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	SpecialCharacters   = "!@#$%^&*()"
)
View Source
const (
	DIGIT = 1 << iota
	LOWER
	UPPER
	SPECIAL
)

Variables

This section is empty.

Functions

func Bytes2String

func Bytes2String(b []byte) string

func GenerateRandomString

func GenerateRandomString(n int, flag int, OptCharset ...string) (string, error)

Types

type RandStr

type RandStr struct {
	Charset string
}

func NewRandStr

func NewRandStr(charset string) *RandStr

func (*RandStr) GenerateRandomString

func (r *RandStr) GenerateRandomString(n int) (string, error)

Jump to

Keyboard shortcuts

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