diff --git a/php/random_bytes.go b/php/random_bytes.go new file mode 100644 index 0000000..7c3194f --- /dev/null +++ b/php/random_bytes.go @@ -0,0 +1,10 @@ +package php + +import "crypto/rand" + +// RandomBytes — Generates cryptographically secure pseudo-random bytes +func RandomBytes(len int) []byte { + b := make([]byte, len) + _, _ = rand.Read(b) + return b +}