Documentation ¶
Index ¶
- Constants
- func ChooseOneInStringSlice(sList []string) string
- func CryptoRandUint64NotZero() uint64
- func EncodeReadableAlphaNumForRand(b []byte) string
- func EncodeReadableAlphaNumForRandNoAlloc(b []byte, tmpBuf []byte) string
- func Float32() float32
- func Float64() float64
- func Float64Between(min float64, max float64) float64
- func GetRandOneInStringSlice(sList []string) string
- func HappendBaseOnPossibility(possibility float64) bool
- func Int63Between(min int64, max int64) int64
- func IntBetween(min int, max int) int
- func IntSliceBetween(start int, end int, size int) []int
- func Intn(num int) (out int)
- func MustCryptoRandBytes(length int) []byte
- func MustCryptoRandBytesWithBuf(buf []byte)
- func MustCryptoRandFromByteList(length int, list string) string
- func MustCryptoRandFromByteListNoAlloc(length int, list string, tmpBuf []byte) []byte
- func MustCryptoRandFromRandomContent(randomContent []byte, list string) string
- func MustCryptoRandToAlphaNum(length int) string
- func MustCryptoRandToHex(length int) string
- func MustCryptoRandToNum(length int) string
- func MustCryptoRandToNumWithRandomContent(randomContent []byte) string
- func MustCryptoRandToReadableAlpha(length int) string
- func MustCryptoRandToReadableAlphaNum(length int) string
- func MustCryptoRandToReadableAlphaNumNoAlloc(length int, tmpBuf []byte) []byte
- func MustCryptoRandUint16() uint16
- func MustCryptoRandUint64() uint64
- func MustCryptoRandUint64NotZero() uint64
- func MustPermInterfaceSlice(obj interface{}) (output interface{})
- func MustPermInterfaceSliceInPlace(obj interface{})
- func NewCryptSeedMathRand() (r *mrand.Rand)
- func Perm(num int) (out []int)
- func PermFromCacheNoAlloc(cache []int, start int, end int, output []int)
- func PermNoAlloc(randomIndexArray []int)
- func PermStringSlice(slice []string) (output []string)
- func PermStringSliceAndReturnPart(slice []string, partLen int) (output []string)
- func RandRunOneFromFuncList(funList []func())
- func RandUint64FromUint64(srcPort uint64) uint64
- func TimeDurationBetween(min time.Duration, max time.Duration) time.Duration
- type CombinatoricsRandom2d
- type LcgTransformer
- type PossibilityWeightRander
- type PossibilityWeightRanderV2
- type UdwRand
- func (r *UdwRand) ChoiceFromIntSlice(slice []int) int
- func (r *UdwRand) Float32() float32
- func (r *UdwRand) Float64() float64
- func (r *UdwRand) Float64Between(min float64, max float64) float64
- func (r *UdwRand) HappendBaseOnPossibility(possibility float64) bool
- func (r *UdwRand) Int63Between(min int64, max int64) int64
- func (r *UdwRand) IntBetween(min int, max int) int
- func (r *UdwRand) Intn(n int) int
- func (r *UdwRand) MulitChoice(totalLength int, choiceNumber int) []int
- func (r *UdwRand) MulitChoiceOriginOrder(n int, size int) []int
- func (r *UdwRand) Perm(n int) []int
- func (r *UdwRand) PermIntSlice(slice []int) (output []int)
- func (r *UdwRand) PermNoAllocNoLock(randomIndexArray []int)
- func (r *UdwRand) ShuffleIntArrayNoAllocNoLock(arr []int, ShuffleNum int)
- func (r *UdwRand) TimeDurationBetween(min time.Duration, max time.Duration) time.Duration
Constants ¶
View Source
const ReadableAlphaNumMap = "23456789abcdefghjkmnpqrstuvwxyz"
Variables ¶
This section is empty.
Functions ¶
func ChooseOneInStringSlice ¶
func CryptoRandUint64NotZero ¶
func CryptoRandUint64NotZero() uint64
func Float64Between ¶
func GetRandOneInStringSlice ¶
func Int63Between ¶
func IntBetween ¶
func MustCryptoRandBytes ¶
func MustCryptoRandBytesWithBuf ¶
func MustCryptoRandBytesWithBuf(buf []byte)
func MustCryptoRandToHex ¶
func MustCryptoRandToNum ¶
func MustCryptoRandUint16 ¶
func MustCryptoRandUint16() uint16
func MustCryptoRandUint64 ¶
func MustCryptoRandUint64() uint64
func MustCryptoRandUint64NotZero ¶
func MustCryptoRandUint64NotZero() uint64
func MustPermInterfaceSlice ¶
func MustPermInterfaceSlice(obj interface{}) (output interface{})
func MustPermInterfaceSliceInPlace ¶
func MustPermInterfaceSliceInPlace(obj interface{})
func NewCryptSeedMathRand ¶
func PermFromCacheNoAlloc ¶
func PermNoAlloc ¶
func PermNoAlloc(randomIndexArray []int)
func PermStringSlice ¶
func RandRunOneFromFuncList ¶
func RandRunOneFromFuncList(funList []func())
func RandUint64FromUint64 ¶
Types ¶
type CombinatoricsRandom2d ¶
type CombinatoricsRandom2d struct { ANumList []int BNumList []int ValidCombine [][]bool Output []udwMath.IntVector2 }
func (*CombinatoricsRandom2d) Random ¶
func (c *CombinatoricsRandom2d) Random(r *UdwRand) (err error)
type LcgTransformer ¶
func (LcgTransformer) Generate ¶
func (t LcgTransformer) Generate(i uint64) (output uint64)
func (LcgTransformer) GenerateInRange ¶
func (t LcgTransformer) GenerateInRange(i uint64) (output uint64)
type PossibilityWeightRander ¶
func NewPossibilityWeightRander ¶
func NewPossibilityWeightRander(weightList []float64) PossibilityWeightRander
func (PossibilityWeightRander) ChoiceOne ¶
func (p PossibilityWeightRander) ChoiceOne(r *UdwRand) (Index int)
type PossibilityWeightRanderV2 ¶
func NewPossibilityWeightRanderV2 ¶
func NewPossibilityWeightRanderV2(resultWeightMap map[string]float64) PossibilityWeightRanderV2
func (PossibilityWeightRanderV2) ChoiceOne ¶
func (p PossibilityWeightRanderV2) ChoiceOne(r *UdwRand) (result string)
type UdwRand ¶
func MustNewCryptSeedUdwRand ¶
func MustNewCryptSeedUdwRand() (r *UdwRand)
func NewInt64SeedUdwRand ¶
func (*UdwRand) ChoiceFromIntSlice ¶
func (*UdwRand) HappendBaseOnPossibility ¶
func (*UdwRand) MulitChoice ¶
func (*UdwRand) MulitChoiceOriginOrder ¶
func (*UdwRand) PermIntSlice ¶
func (*UdwRand) PermNoAllocNoLock ¶
func (*UdwRand) ShuffleIntArrayNoAllocNoLock ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.