5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-30 19:45:40 +00:00
matterbridge/vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.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
}