MCPcopy Create free account
hub / github.com/agentcodee/cursor-free-everyday / new_standard_machine_id

Function new_standard_machine_id

reset_machine.rs:282–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282fn new_standard_machine_id() -> String {
283 // Template: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
284 // y is one of 8, 9, a, b
285 let mut rng = thread_rng();
286 let mut id = String::with_capacity(36);
287 for (i, char_template) in "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".chars().enumerate() {
288 if char_template == '-' || char_template == '4' {
289 id.push(char_template);
290 } else if char_template == 'x' {
291 id.push_str(&format!("{:x}", rng.gen_range(0..16)));
292 } else if char_template == 'y' {
293 id.push_str(&format!("{:x}", rng.gen_range(8..12))); // 8, 9, a, b
294 }
295 }
296 id
297}
298
299#[derive(Deserialize)]
300struct PackageJson {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected