randx

package
v0.0.0-...-cb58a95 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

math/rand扩展包,也包括生成随机字符串,随机选择等功能。

Index

Constants

This section is empty.

Variables

View Source
var (
	LowerLetters   = "abcdefghijklmnopqrstuvwxyz"
	UpperLetters   = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Letters        = LowerLetters + UpperLetters
	Numbers        = "0123456789"
	LettersNumbers = Letters + Numbers
)

Functions

func Choice

func Choice(choices ...interface{}) interface{}

func ChoiceInt

func ChoiceInt(choices ...int) int

func ChoiceInt64

func ChoiceInt64(choices ...int64) int64

func ChoiceSlice

func ChoiceSlice(choicesSlice interface{}) interface{}

func ChoiceStr

func ChoiceStr(choices ...string) string

func ChoiceW

func ChoiceW(choices ...W) interface{}

func Float64Between

func Float64Between(low, high float64) float64

func InitSeed

func InitSeed()

func InitToken

func InitToken(size int) string

func Int64Between

func Int64Between(low, high int64) int64

func IntBetween

func IntBetween(low, high int) int

func RandomStr

func RandomStr(n int) string

func Str

func Str(set string, n int) string

Types

type W

type W struct {
	W int         `json:"w" bson:"w"`
	V interface{} `json:"v" bson:"v"`
}

Jump to

Keyboard shortcuts

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