1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-05-12 14:47:46 +00:00

Fix SID generation

I messed this up when porting to fastrand, it ended up extending *one*
single letter to 56 chars.
This commit is contained in:
Joshua Goins 2025-05-06 16:12:46 -04:00
parent 092cec19d5
commit 8790f443a2

View file

@ -112,8 +112,9 @@ impl LoginDatabase {
} }
fn generate_sid() -> String { fn generate_sid() -> String {
let random_id: String = String::from_utf8([fastrand::alphanumeric() as u8; 56].to_vec()) let random_id: String =
.expect("Failed to create random SID"); String::from_utf8((0..56).map(|_| fastrand::alphanumeric() as u8).collect())
.expect("Failed to create random SID");
random_id.to_lowercase() random_id.to_lowercase()
} }