(provenance_id: u64, todo_id: &str)
| 216 | /// the B-tree) matches numeric order, enabling correct prefix range scans. |
| 217 | #[inline] |
| 218 | pub fn encode_session_todo_key(provenance_id: u64, todo_id: &str) -> [u8; 16] { |
| 219 | let hash = blake3::hash(todo_id.as_bytes()); |
| 220 | let hash_bytes = hash.as_bytes(); |
| 221 | let mut key = [0u8; 16]; |
| 222 | key[0..8].copy_from_slice(&provenance_id.to_be_bytes()); |
| 223 | key[8..16].copy_from_slice(&hash_bytes[0..8]); |
| 224 | key |
| 225 | } |
| 226 | |
| 227 | /// Decode the `provenance_id` from a `SESSION_TODOS` key. |
| 228 | /// |