(provenance_id: u64, phase_name: &str)
| 483 | /// the B-tree) matches numeric order, enabling correct prefix range scans. |
| 484 | #[inline] |
| 485 | pub fn encode_session_phase_key(provenance_id: u64, phase_name: &str) -> [u8; 16] { |
| 486 | let hash = blake3::hash(phase_name.as_bytes()); |
| 487 | let hash_bytes = hash.as_bytes(); |
| 488 | let mut key = [0u8; 16]; |
| 489 | key[0..8].copy_from_slice(&provenance_id.to_be_bytes()); |
| 490 | key[8..16].copy_from_slice(&hash_bytes[0..8]); |
| 491 | key |
| 492 | } |
| 493 | |
| 494 | /// Decode the `provenance_id` from a `SESSION_PHASES` key. |
| 495 | /// |