moving random.go from utils
Closes #10962 Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
This commit is contained in:
parent
c9b4e665f9
commit
38752a5727
2 changed files with 68 additions and 0 deletions
|
@ -36,3 +36,12 @@ func GenerateRandomID() string {
|
|||
return value
|
||||
}
|
||||
}
|
||||
|
||||
func RandomString() string {
|
||||
id := make([]byte, 32)
|
||||
|
||||
if _, err := io.ReadFull(rand.Reader, id); err != nil {
|
||||
panic(err) // This shouldn't happen
|
||||
}
|
||||
return hex.EncodeToString(id)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue