summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/pls/nonce.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/pls/nonce.go b/pkg/pls/nonce.go
new file mode 100644
index 0000000..aeab640
--- /dev/null
+++ b/pkg/pls/nonce.go
@@ -0,0 +1,11 @@
+package pls
+
+import (
+ "crypto/rand"
+)
+
+func GenerateNonce(size int) string {
+ nonceBytes := make([]byte, size)
+ rand.Read(nonceBytes)
+ return string(nonceBytes)
+}