memory-search: use uuid for cookie instead of manual /dev/urandom

This commit is contained in:
ProofOfConcept 2026-02-28 23:50:54 -05:00
parent 300a09e04b
commit 53bc5a0ddc

View file

@ -150,11 +150,7 @@ fn load_or_create_cookie(dir: &Path, session_id: &str) -> String {
} }
fn generate_cookie() -> String { fn generate_cookie() -> String {
let mut buf = [0u8; 12]; uuid::Uuid::new_v4().as_simple().to_string()[..12].to_string()
fs::File::open("/dev/urandom")
.and_then(|mut f| io::Read::read_exact(&mut f, &mut buf))
.expect("failed to read urandom");
buf.iter().map(|b| format!("{:02x}", b)).collect()
} }
fn load_seen(dir: &Path, session_id: &str) -> HashSet<String> { fn load_seen(dir: &Path, session_id: &str) -> HashSet<String> {