diff -r c7c23bb036c9 -r 2097f63575a5 rust/hg-core/src/revlog/node.rs --- a/rust/hg-core/src/revlog/node.rs Thu Dec 02 12:05:36 2021 +0100 +++ b/rust/hg-core/src/revlog/node.rs Thu Dec 02 15:10:03 2021 +0100 @@ -174,6 +174,12 @@ data: self.data, } } + + pub fn pad_to_256_bits(&self) -> [u8; 32] { + let mut bits = [0; 32]; + bits[..NODE_BYTES_LENGTH].copy_from_slice(&self.data); + bits + } } /// The beginning of a binary revision SHA.