Discover Packages
gitlab.com/lightnet1/evrynet-node
common
random
package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Sep 13, 2021
License: GPL-3.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Base64 generates a random base64 string with length of n
Bytes generates n random bytes
Hex generates a random hex string with length of n
e.g: 67aab2d956bd7cc621af22cfb169cba8
for i := 0; i < 5; i++ {
token := Hex(16)
fmt.Println(token)
}
Output:
String generates a random string using only letters provided in the letters parameter
if user ommit letters parameters, this function will use defLetters instead
for i := 0; i < 5; i++ {
token := String(16)
fmt.Println(token)
}
Output:
Source Files
¶
Click to show internal directories.
Click to hide internal directories.