Random string generator of arbitrary size.
import (
"github.com/neptulon/randstr"
)
func main() {
str := randstr.Get(96)
// str: "VkNT!pQXdtHgyffWMIqNZcnOECWhVYYafBGTDjJvE PlyaWs!UKiKxGQkquNafewfcU ECXgQfYtyZkFIXEJmIYVPRYaIzh"
}
The default alphabet contains 'space', 'dot', 'exclamation mark', and upper and lowercase English alphabetic characters:
var Alphabet = []rune(". !abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
You can replace the alphabet used in creating the random string via reassigning the Alphabet
variable:
randstr.Alphabet = []rune("abcdefg1234567")