Documentation ¶
Index ¶
- Variables
- func Bytes(n int) ([]byte, error)
- func Choice(j []string) (string, error)
- func ChoiceInsecure(j []string) string
- func GetInt(max int) (int, error)
- func GetIntInsecure(i int) int
- func IntRange(min int, max int) (int, error)
- func Random(n int, charset string, isSecure bool) (string, error)
- func String(n int) (string, error)
- func StringInsecure(n int) (string, error)
- func StringRange(min int, max int) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Digits string = "0123456789" // Digits: [0-9] ASCIILettersLowercase string = "abcdefghijklmnopqrstuvwxyz" // Asci Lowerrcase Letters: [a-z] ASCIILettersUppercase string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // Ascii Uppercase Letters: [A-Z] Letters string = ASCIILettersLowercase + ASCIILettersUppercase // Ascii Letters: [a-zA-Z] ASCIICharacters string = ASCIILettersLowercase + ASCIILettersUppercase + Digits // Ascii Charaters: [a-zA-Z0-9] Hexdigits string = "0123456789abcdefABCDEF" // Hex Digits: [0-9a-fA-F] Octdigits string = "01234567" // Octal Digits: [0-7] Punctuation string = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" // Punctuation and special characters Printables string = Digits + ASCIILettersLowercase + ASCIILettersUppercase + Punctuation // Printables )
Functions ¶
func ChoiceInsecure ¶
Choice makes a random choice from a slice of string. Use only when the random choice does not require to be secure.
func GetIntInsecure ¶
GetIntInsecure generate a random integer using a seed of current system time.
func StringInsecure ¶
String generates a cryptographically insecure string. Use only when generating random data that does not require to be secure.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.