summaryrefslogtreecommitdiff
path: root/src/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/token.rs')
-rw-r--r--src/token.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/token.rs b/src/token.rs
new file mode 100644
index 0000000..3de71ce
--- /dev/null
+++ b/src/token.rs
@@ -0,0 +1,6 @@
+pub fn generate() -> String {
+ let mut rng = urandom::csprng();
+ let mut bytes = [0u8; 32];
+ rng.fill_bytes(&mut bytes);
+ bs58::encode(bytes).into_string()
+} \ No newline at end of file