Documentation ¶
Index ¶
- Variables
- func CryptoRandom(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error)
- func CryptoRandomAlphaNumeric(count int) (string, error)
- func CryptoRandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error)
- func CryptoRandomAlphabetic(count int) (string, error)
- func CryptoRandomAscii(count int) (string, error)
- func CryptoRandomNonAlphaNumeric(count int) (string, error)
- func CryptoRandomNumeric(count int) (string, error)
- func Random(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error)
- func RandomAlphaNumeric(count int) (string, error)
- func RandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error)
- func RandomAlphabetic(count int) (string, error)
- func RandomAscii(count int) (string, error)
- func RandomNonAlphaNumeric(count int) (string, error)
- func RandomNumeric(count int) (string, error)
- func RandomSeed(count int, start int, end int, letters bool, numbers bool, chars []rune, ...) (string, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CryptoRandom ¶
func CryptoRandomAlphabetic ¶
func CryptoRandomAscii ¶
func CryptoRandomNumeric ¶
func RandomAlphaNumeric ¶
func RandomAlphabetic ¶
func RandomAscii ¶
func RandomNonAlphaNumeric ¶
func RandomNumeric ¶
func RandomSeed ¶
func RandomSeed(count int, start int, end int, letters bool, numbers bool, chars []rune, random *rand.Rand) (string, error)
Example ¶
var seed int64 = 10 // If you change this seed #, the random sequence below will change random := rand.New(rand.NewSource(seed)) chars := []rune{'1', '2', '3', 'a', 'b', 'c'} rand1, _ := RandomSeed(5, 0, 0, true, true, nil, random) // RandomAlphaNumeric (Alphabets and numbers possible) rand2, _ := RandomSeed(5, 0, 0, true, false, nil, random) // RandomAlphabetic (Only alphabets) rand3, _ := RandomSeed(5, 0, 0, false, true, nil, random) // RandomNumeric (Only numbers) rand4, _ := RandomSeed(5, 32, 127, false, false, nil, random) // RandomAscii (Alphabets, numbers, and other ASCII chars) rand5, _ := RandomSeed(5, 0, 0, true, true, chars, random) // RandomSeed with custom characters fmt.Println(rand1) fmt.Println(rand2) fmt.Println(rand3) fmt.Println(rand4) fmt.Println(rand5)
Output: 3ip9v MBrbj 88935 H_I;E 2b2ca
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.