DNS Benchmarking Tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rnd.go 306B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "math/rand"
  4. "time"
  5. )
  6. func init() {
  7. rand.Seed(time.Now().UnixNano())
  8. }
  9. var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
  10. func RandStringRunes(n int) string {
  11. b := make([]rune, n)
  12. for i := range b {
  13. b[i] = letterRunes[rand.Intn(len(letterRunes))]
  14. }
  15. return string(b)
  16. }