Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // All represents the string instruction set that contains all alpha-numeric characters. All set = [2]int{0, 62} // Upper represents the string instruction set that contains only uppercase non-numeric characters. Upper set = [2]int{26, 52} // Lower represents the string instruction set that contains only lowercase non-numeric characters. Lower set = [2]int{0, 26} // Numbers represents the string instruction set that contains only numeric characters. Numbers set = [2]int{52, 62} // Characters represents the string instruction set that contains mixed case non-numeric characters. Characters set = [2]int{0, 52} )
var Rand = &random{Rand: rand.New(rand.NewSource(cputicks()))}
Rand is the custom Random number generator, based on the current time as a seed.
Functions ¶
func Decode ¶
Decode is used to un-encode a string written in a XOR byte array "encrypted" by the specified key. This function returns the string value of the result but also modifies the input array, which can be used to re-use the resulting string.
func FastRand ¶
func FastRand() uint32
FastRand is a fast thread local random function. This should be used in place instead of 'Rand.Uint32()'.
Taken from https://github.com/dgraph-io/ristretto/blob/master/z/rtutil.go Thanks!
func FastRandN ¶
FastRandN is a fast thread local random function. This should be used in place instead of 'Rand.Uint32n()'. This function will take a max value to specify.
func FastUTF8Match ¶
FastUTF8Match is a function that will return true if both of the strings match regardless of case (case insensitive). This function ONLY works properly on UTF8 characters as the tradeoff for fastness.
Types ¶
This section is empty.