Generate a short hex string for fallback session IDs. This is only used when the Pi extension fails to provide a session_id, which should be rare. Uses timestamp bits for uniqueness.
()
| 549 | /// This is only used when the Pi extension fails to provide a session_id, |
| 550 | /// which should be rare. Uses timestamp bits for uniqueness. |
| 551 | fn uuid_short() -> String { |
| 552 | use std::time::{SystemTime, UNIX_EPOCH}; |
| 553 | |
| 554 | let now = SystemTime::now() |
| 555 | .duration_since(UNIX_EPOCH) |
| 556 | .unwrap_or_default() |
| 557 | .as_millis(); |
| 558 | |
| 559 | // Use lower 32 bits of timestamp for a short hex ID |
| 560 | format!("{:08x}", (now & 0xFFFF_FFFF) as u32) |
| 561 | } |
| 562 | |
| 563 | // Pi hook verb → HookType mapping |
| 564 |
no outgoing calls