mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-12-30 19:45:40 +00:00
16 lines
241 B
Go
16 lines
241 B
Go
package randbytes
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"fmt"
|
|
)
|
|
|
|
func Make(length int) []byte {
|
|
random := make([]byte, length)
|
|
_, err := rand.Read(random)
|
|
if err != nil {
|
|
panic(fmt.Errorf("failed to get random bytes: %w", err))
|
|
}
|
|
return random
|
|
}
|