Documentation ¶
Index ¶
- Constants
- Variables
- func Base32ID(prefix IDPrefix) string
- func Bytes(n int) []byte
- func Code(length int) string
- func Distinguishable(length int) string
- func Email() string
- func Hex(length int) string
- func HexColor() string
- func ID(prefix IDPrefix) string
- func Int() int
- func Int16() int16
- func Int32() int32
- func Name() string
- func Password(length int) string
- func Secret() string
- func String(length int) string
- func TestID() string
- func UInt16() uint16
- func UInt32() uint32
- func Year() int32
- type IDPrefix
Constants ¶
View Source
const Base32IDSizeBytes = 18
Base32IDSizeBytes is the length of a base 32 identifier in bytes in the system.
View Source
const IDSizeBytes = 32
IDSizeBytes is the length of an identifier in bytes in the system.
View Source
const MaxPrefix = 8
MaxPrefix is the maximum ID prefix length
Variables ¶
View Source
var ( // AlphaRunes is the runes [a-zA-Z] AlphaRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") // HexRunes are those digits and characters that can occur as part of // a hexadecimal number representation (0-9, A-F) HexRunes = []rune("0123456789ABCDEF") // DigitRunes are the 10 digits [0-9] DigitRunes = []rune("0123456789") // SymbolRunes are the special characters [!@#$%`'^&*()_+] SymbolRunes = []rune("!@#$%`'^&*()_+") // UnreservedSymbolRunes are the symbols that are not reserved in URLs UnreservedSymbolRunes = ("-._~") )
Functions ¶
func Distinguishable ¶ added in v2.18.3
Distinguishable returns random alphanumerics of the requested length, excluding similar characters (e.g. 0, O, 1, l, I)
Types ¶
Click to show internal directories.
Click to hide internal directories.