()
| 40 | } |
| 41 | |
| 42 | pub fn generate_pairing_code() -> String { |
| 43 | let token = generate_access_token(); |
| 44 | let value = u32::from_str_radix(&token[..8], 16).unwrap_or_default() % 1_000_000; |
| 45 | format!("{value:06}") |
| 46 | } |
| 47 | |
| 48 | pub fn pairing_code_matches(config: &Config, value: &str) -> bool { |
| 49 | let Some(pairing_code) = config.pairing_code.as_deref() else { |
no test coverage detected