tool

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 2 Imported by: 4

README

tool

Random string generation function. it return the different values all the time.

GenerateRandom(size,...kind) []byte
GenerateRandomString(size,...king) string

kind is option argusments

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RandomString = []string{
		RandomNum:      "0123456789",
		RandomLower:    "abcdefghijklmnopqrstuvwxyz",
		RandomUpper:    "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
		RandomLowerNum: "0123456789abcdefghijklmnopqrstuvwxyz",
		RandomUpperNum: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",
		RandomAll:      "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
	}
)

RandomString defines

Functions

func GenerateRandom

func GenerateRandom(size int, kind ...RandomKind) []byte

GenerateRandom random characters with []byte

func GenerateRandomString

func GenerateRandomString(size int, kind ...RandomKind) string

GenerateRandomString 随机字符串

Types

type RandomKind

type RandomKind int

RandomKind RandomKind

const (
	RandomNum      RandomKind = iota // 纯数字
	RandomLower                      // 小写字母
	RandomUpper                      // 大写字母
	RandomLowerNum                   // 数字、小写字母
	RandomUpperNum                   // 数字、大写字母
	RandomAll                        // 数字、大小写字母
)

random kinds

Jump to

Keyboard shortcuts

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