Files
docker-cli/components/engine/utils/random.go
Solomon Hykes e490910840 Engine: basic testing harness
Upstream-commit: 2a29bf624536c9daed25966dcaf80d840d0972c3
Component: engine
2013-10-26 14:18:28 -07:00

17 lines
248 B
Go

package utils
import (
"io"
"crypto/rand"
"encoding/hex"
)
func RandomString() string {
id := make([]byte, 32)
_, err := io.ReadFull(rand.Reader, id)
if err != nil {
panic(err) // This shouldn't happen
}
return hex.EncodeToString(id)
}