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

Function uuid_short

atomic-agent/src/hooks/cursor.rs:758–768  ·  view source on GitHub ↗

Generate a short hex string for fallback session IDs. Only used when Cursor fails to provide a conversation_id or session_id, which should be rare. Uses timestamp bits for uniqueness.

()

Source from the content-addressed store, hash-verified

756/// Only used when Cursor fails to provide a conversation_id or session_id,
757/// which should be rare. Uses timestamp bits for uniqueness.
758fn uuid_short() -> String {
759 use std::time::{SystemTime, UNIX_EPOCH};
760
761 let now = SystemTime::now()
762 .duration_since(UNIX_EPOCH)
763 .unwrap_or_default()
764 .as_millis();
765
766 // Use lower 32 bits of timestamp for a short hex ID
767 format!("{:08x}", (now & 0xFFFF_FFFF) as u32)
768}
769
770/// Convert a Cursor-specific verb to a [`HookType`].
771///

Callers 2

test_uuid_short_formatFunction · 0.70

Calls

no outgoing calls

Tested by 2

test_uuid_short_formatFunction · 0.56