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

Function uuid_short

atomic-agent/src/hooks/cline.rs:495–505  ·  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

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

Callers 2

test_uuid_short_formatFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_uuid_short_formatFunction · 0.56