MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / confirmation_codes_are_unique

Function confirmation_codes_are_unique

crates/openshell-cli/src/auth.rs:462–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

460
461 #[test]
462 fn confirmation_codes_are_unique() {
463 let codes: Vec<_> = (0..10).map(|_| generate_confirmation_code()).collect();
464 // While theoretically possible to collide, 10 codes from a 32^7 space
465 // should practically never collide.
466 let unique: std::collections::HashSet<_> = codes.iter().collect();
467 assert!(
468 unique.len() > 1,
469 "codes should be random, got all identical: {codes:?}"
470 );
471 }
472
473 // ---------------------------------------------------------------
474 // Origin extraction

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected