mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-30 22:52:00 -08: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
|
|
}
|