Files
crypto/random.go
T
2025-07-25 20:12:57 -05:00

17 lines
378 B
Go

// Copyright (C) 2020-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package crypto
import (
"crypto/rand"
)
// RandomBytes returns a slice of n random bytes
func RandomBytes(n int) []byte {
bytes := make([]byte, n)
// #nosec G404 - we don't need cryptographic randomness for test data
_, _ = rand.Read(bytes)
return bytes
}