Function username_to_cid
pub fn username_to_cid(username: &str) -> u64Expand description
Generates a CID given a username.
Uses SHA3-256 truncated to 64 bits rather than a non-cryptographic hash. The CID is the account primary key (SQL PK / Redis key / on-disk filename), so a cheaply-craftable collision would let an attacker squat or overwrite a victim’s account record. With a cryptographic hash, finding any collision requires ~2^32 work (birthday) and a targeted second preimage ~2^64; combined with the registration-time existence check (a colliding username is reported as already-registered), this closes the collision-driven squat/overwrite vector.