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 11287f7714
commit 6896016b7c
4 changed files with 6 additions and 41 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