MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / canonical_root_bytes

Function canonical_root_bytes

atomic-repository/src/change_source/scan.rs:952–960  ·  view source on GitHub ↗
(rows: &[Vec<u8>])

Source from the content-addressed store, hash-verified

950}
951
952fn canonical_root_bytes(rows: &[Vec<u8>]) -> Vec<u8> {
953 let mut bytes = b"atomic.verified-candidates-v1\0".to_vec();
954 bytes.extend_from_slice(&(rows.len() as u64).to_le_bytes());
955 for row in rows {
956 bytes.extend_from_slice(&(row.len() as u64).to_le_bytes());
957 bytes.extend_from_slice(row);
958 }
959 bytes
960}
961
962#[cfg(all(test, unix))]
963mod tests {

Callers 1

Calls 2

to_le_bytesMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected