k3s/vendor/github.com/k3s-io/go-powershell/utils/rand.go
Jacob Blain Christen b4a51f2b9a
[migration k3s-io] update flannel and go-powershell replace directives (#2576)
rancher/flannel ➡️ k3s-io/flannel
rancher/go-powershell ➡️ k3s-io/go-powershell

Part of https://github.com/rancher/k3s/issues/2189

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
2020-12-01 08:12:18 -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)
}