MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / generate_pairing_code

Function generate_pairing_code

packages/server/src/auth.rs:42–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42pub 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
48pub fn pairing_code_matches(config: &Config, value: &str) -> bool {
49 let Some(pairing_code) = config.pairing_code.as_deref() else {

Callers 3

start_project_serviceFunction · 0.85
mainFunction · 0.85
apply_credentialsFunction · 0.85

Calls 1

generate_access_tokenFunction · 0.85

Tested by

no test coverage detected