612a25fb9f
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
16 lines
214 B
Go
16 lines
214 B
Go
package dagger
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
)
|
|
|
|
func randomID(size int) (string, error) {
|
|
b := make([]byte, size)
|
|
_, err := rand.Read(b)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return fmt.Sprintf("%x", b), nil
|
|
}
|