Fixes #11721 removed GenerateRandomString

Signed-off-by: Peter Esbensen <pkesbensen@gmail.com>

gofmt

Signed-off-by: Peter Esbensen <pkesbensen@gmail.com>
This commit is contained in:
Peter Esbensen 2015-04-01 07:21:07 -07:00
parent ae440baf74
commit 88e878b013
2 changed files with 2 additions and 37 deletions

View file

@ -1,23 +1,10 @@
package stringutils
import (
"crypto/rand"
"encoding/hex"
"io"
mathrand "math/rand"
"time"
)
// Generate 32 chars random string
func GenerateRandomString() string {
id := make([]byte, 32)
if _, err := io.ReadFull(rand.Reader, id); err != nil {
panic(err) // This shouldn't happen
}
return hex.EncodeToString(id)
}
// Generate alpha only random stirng with length n
func GenerateRandomAlphaOnlyString(n int) string {
// make a really long string