MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / uuid_short

Function uuid_short

atomic-agent/src/hooks/cline.rs:503–513  ·  view source on GitHub ↗

Generate a short hex string for fallback session IDs. Only used when Cline fails to provide a `taskId`, which should be rare. Uses timestamp bits for uniqueness.

()

Source from the content-addressed store, hash-verified

501/// Only used when Cline fails to provide a `taskId`, which should be
502/// rare. Uses timestamp bits for uniqueness.
503fn uuid_short() -> String {
504 use std::time::{SystemTime, UNIX_EPOCH};
505
506 let now = SystemTime::now()
507 .duration_since(UNIX_EPOCH)
508 .unwrap_or_default()
509 .as_millis();
510
511 // Use lower 32 bits of timestamp for a short hex ID
512 format!("{:08x}", (now & 0xFFFF_FFFF) as u32)
513}
514
515// =============================================================================
516// Tests

Callers 2

test_uuid_short_formatFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_uuid_short_formatFunction · 0.56