k3s/vendor/github.com/rancher/go-powershell/utils/rand.go
Brad Davidson 1de58904ad Update flannel to v0.12.0-k3s1
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2020-07-20 13:18:46 -07:00

21 lines
284 B
Go

// Copyright (c) 2017 Gorillalabs. All rights reserved.
package utils
import (
"crypto/rand"
"encoding/hex"
)
func CreateRandomString(bytes int) string {
c := bytes
b := make([]byte, c)
_, err := rand.Read(b)
if err != nil {
panic(err)
}
return hex.EncodeToString(b)
}