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

Function chain_hash

atomic-core/src/pristine/traits/view.rs:1138–1143  ·  view source on GitHub ↗
(id: u64)

Source from the content-addressed store, hash-verified

1136 }
1137
1138 fn chain_hash(id: u64) -> Hash {
1139 let mut bytes = [0u8; 32];
1140 bytes[..8].copy_from_slice(&id.to_le_bytes());
1141 bytes[8..17].copy_from_slice(b"n13-chain");
1142 Hash::from_bytes(bytes)
1143 }
1144
1145 #[test]
1146 fn membership_preserves_first_occurrence_and_without_order() {

Calls 1

to_le_bytesMethod · 0.80