diff options
| author | Jeroen Wijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-03 18:04:17 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-05 12:26:12 +0200 |
| commit | 7c5e5081161572102a56fa8495208a9eabb0b224 (patch) | |
| tree | b7c37ab09503054d15645e822d3e5207b3ef178a /src/util.go | |
| parent | e89a5b72f0331d0a0209357169a9e0447788abb1 (diff) | |
OAuth: Add initial draft
Signed-off-by: Jeroen Wijenbergh <jeroenwijenbergh@protonmail.com>
Diffstat (limited to 'src/util.go')
| -rw-r--r-- | src/util.go | 15 |
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 +} |
