Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/revlog/node.rs @ 45531:b0d6309ff50c
hg-core: check data integrity in `Revlog`
Check that the hash of the data reconstructed from deltas
matches the hash stored in the revision.
Differential Revision: https://phab.mercurial-scm.org/D9005
author | Antoine Cezar <antoine.cezar@octobus.net> |
---|---|
date | Wed, 02 Sep 2020 15:23:25 +0200 |
parents | 26114bd6ec60 |
children | 88e741bf2d93 |
comparison
equal
deleted
inserted
replaced
45530:b1cea0dc9db0 | 45531:b0d6309ff50c |
---|---|
14 /// | 14 /// |
15 /// This constant is meant to ease refactors of this module, and | 15 /// This constant is meant to ease refactors of this module, and |
16 /// are private so that calling code does not expect all nodes have | 16 /// are private so that calling code does not expect all nodes have |
17 /// the same size, should we support several formats concurrently in | 17 /// the same size, should we support several formats concurrently in |
18 /// the future. | 18 /// the future. |
19 const NODE_BYTES_LENGTH: usize = 20; | 19 pub const NODE_BYTES_LENGTH: usize = 20; |
20 | |
21 /// Id of the null node. | |
22 /// | |
23 /// Used to indicate the absence of node. | |
24 pub const NULL_NODE_ID: [u8; NODE_BYTES_LENGTH] = [0u8; NODE_BYTES_LENGTH]; | |
20 | 25 |
21 /// The length in bytes of a `Node` | 26 /// The length in bytes of a `Node` |
22 /// | 27 /// |
23 /// see also `NODES_BYTES_LENGTH` about it being private. | 28 /// see also `NODES_BYTES_LENGTH` about it being private. |
24 const NODE_NYBBLES_LENGTH: usize = 2 * NODE_BYTES_LENGTH; | 29 const NODE_NYBBLES_LENGTH: usize = 2 * NODE_BYTES_LENGTH; |