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