(id: &LeafId)
| 308 | /// ``` |
| 309 | #[inline] |
| 310 | pub fn encode_leaf_id(id: &LeafId) -> [u8; 12] { |
| 311 | let mut bytes = [0u8; 12]; |
| 312 | bytes[0..8].copy_from_slice(&id.change_id().get().to_le_bytes()); |
| 313 | bytes[8..12].copy_from_slice(&id.leaf_idx().to_le_bytes()); |
| 314 | bytes |
| 315 | } |
| 316 | |
| 317 | /// Decode a LeafId from 12 bytes. |
| 318 | #[inline] |