Browse Source

Seed rand

pull/4/head
Tovi Jaeschke-Rogers 2 years ago
parent
commit
5a70720172
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      Backend/Util/Strings.go

+ 6
- 0
Backend/Util/Strings.go View File

@ -2,12 +2,18 @@ package Util
import (
"math/rand"
"time"
)
var (
letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
)
func init() {
rand.Seed(time.Now().UnixNano())
}
// RandomString generates a random string
func RandomString(n int) string {
var (
b []rune


Loading…
Cancel
Save