Skip to content

Instantly share code, notes, and snippets.

@smartass08
Created October 2, 2020 03:03
Show Gist options
  • Save smartass08/5fda5f0d20cca28a4ca571e717990ce5 to your computer and use it in GitHub Desktop.
Save smartass08/5fda5f0d20cca28a4ca571e717990ce5 to your computer and use it in GitHub Desktop.
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
func randSeq(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letters[rand.Intn(len(letters))]
}
return string(b)
}
func main(){
rand.Seed(time.Now().UnixNano())
random_string := randSeq(25)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment