Skip to content

Commit

Permalink
Make size variable
Browse files Browse the repository at this point in the history
  • Loading branch information
SantaClaas committed Feb 9, 2025
1 parent cd60168 commit 3f2b2fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/generate_secret.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine};

fn main() {
let mut key = [0u8; 32];
let mut arguments = std::env::args();
_ = arguments.next();
let argument = arguments.next().unwrap();
let mut key = vec![0u8; argument.parse().unwrap()];
getrandom::getrandom(&mut key).unwrap();
let encoded = BASE64_URL_SAFE_NO_PAD.encode(&key);
println!("{}", encoded);
Expand Down

0 comments on commit 3f2b2fb

Please sign in to comment.