randomtools

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNanoString

func GetNanoString(length int) (string, error)

GetNanoString generate nano string

func GetRandBool

func GetRandBool(trueProb float64) (bool, error)

GetRandBool genetate bool by probability of true response.

Example
result, _ := GetRandBool(1)
fmt.Print(result)
Output:

true

func GetRandEmail

func GetRandEmail() (string, error)

GetRandEmail generate random email

func GetRandEmails

func GetRandEmails(len int) ([]string, error)

GetRandEmails generate random emails

func GetRandFloat64

func GetRandFloat64(max float64) (float64, error)

GetRandFloat64 ...

func GetRandFloat64InRange

func GetRandFloat64InRange(min, max float64) (float64, error)

GetRandFloat64InRange ...

func GetRandFloat64Norm

func GetRandFloat64Norm(stdDev, mean float64) (float64, error)

GetRandFloat64Norm generate random float64 with norm stdDev -standart deviation - σ^2; default = 1 mean - μ (In probability theory, the expected value is a generalization of the weighted average.); default = 0

func GetRandFloat64NormInRange

func GetRandFloat64NormInRange(min, max, stdDev, mean float64) (float64, error)

GetRandFloat64NormInRange ...

func GetRandInt

func GetRandInt(max int) (int, error)

GetRandInt ...

func GetRandIntInRange

func GetRandIntInRange(min int, max int) (int, error)

GetRandIntInRange ...

func GetRandString

func GetRandString(len int) (string, error)

GetRandString generate random string

func GetUUID

func GetUUID() uuid.UUID

GetUUID generate uuid.GetUUID

func GetUUIDString

func GetUUIDString() string

GetUUIDString generate UUID string

func PrepareProbability

func PrepareProbability(in float64) float64

PrepareProbability normalize value to 0.0..1.0

Types

This section is empty.

Jump to

Keyboard shortcuts

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