diff options
Diffstat (limited to 'internal/util/util.go')
| -rw-r--r-- | internal/util/util.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/internal/util/util.go b/internal/util/util.go index 85c4b37..97b4151 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -2,23 +2,12 @@ package util import ( - "crypto/rand" "fmt" "net/url" "os" "strings" ) -// MakeRandomByteSlice creates a cryptographically random bytes slice of `size` -// It returns the byte slice (or nil if error) and an error if it could not be generated. -func MakeRandomByteSlice(n int) ([]byte, error) { - bs := make([]byte, n) - if _, err := rand.Read(bs); err != nil { - return nil, errors.WrapPrefix(err, "failed reading random", 0) - } - return bs, nil -} - // EnsureDirectory creates a directory with permission 700. func EnsureDirectory(dir string) error { // Create with 700 permissions, read, write, execute only for the owner |
