From 3a7cf081f08bcbcad492d4a0d54b6d00771b1359 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 25 Feb 2019 20:09:52 +0100 Subject: [PATCH] Use random Seed --- util.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util.go b/util.go index 5522a39..9d85bce 100644 --- a/util.go +++ b/util.go @@ -2,8 +2,15 @@ package main import ( "math/rand" + "time" ) +var random *rand.Rand + +func init() { + random = rand.New(rand.NewSource(time.Now().UnixNano())) +} + const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" func RandStringBytes(n int) string {