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

Function timestamp_hex

atomic-agent/src/hooks/kiro.rs:418–428  ·  view source on GitHub ↗

Generate a short hex string for fallback session IDs. This is only used when the Kiro hook scripts fail to provide a session_id, which should be rare. Uses timestamp bits for uniqueness.

()

Source from the content-addressed store, hash-verified

416/// This is only used when the Kiro hook scripts fail to provide a session_id,
417/// which should be rare. Uses timestamp bits for uniqueness.
418fn timestamp_hex() -> String {
419 use std::time::{SystemTime, UNIX_EPOCH};
420
421 let now = SystemTime::now()
422 .duration_since(UNIX_EPOCH)
423 .unwrap_or_default()
424 .as_millis();
425
426 // Use lower 32 bits of timestamp for a short hex ID
427 format!("{:08x}", (now & 0xFFFF_FFFF) as u32)
428}
429
430// ---------------------------------------------------------------------------
431// Verb mapping

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected