summaryrefslogtreecommitdiff
path: root/src/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.go')
-rw-r--r--src/util.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.go b/src/util.go
new file mode 100644
index 0000000..1d0df91
--- /dev/null
+++ b/src/util.go
@@ -0,0 +1,15 @@
+package eduvpn
+
+import (
+ "crypto/rand"
+)
+
+// Creates a random byteslice of `size`
+func MakeRandomByteSlice(size int) ([]byte, error) {
+ byteSlice := make([]byte, size)
+ _, err := rand.Read(byteSlice)
+ if err != nil {
+ return nil, err
+ }
+ return byteSlice, nil
+}