From 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 5 Aug 2023 20:43:19 +0200 Subject: Update dependencies and remove old matterclient lib (#2067) --- vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.go (limited to 'vendor/go.mau.fi/whatsmeow/util/randbytes') diff --git a/vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.go b/vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.go new file mode 100644 index 00000000..befcd4e9 --- /dev/null +++ b/vendor/go.mau.fi/whatsmeow/util/randbytes/randbytes.go @@ -0,0 +1,15 @@ +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 +} -- cgit v1.2.3