cuprate-hinto-janai/consensus/fast-sync/src/util.rs
jomuel 663c852b13
Fast sync (WIP) (#155)
* Fast sync (work in progress)

* Cargo.lock

* Add missing hashes file

* clippy warnings

* Stub of database tool to create the fast sync hashes

* Command line arg for target height, error handling

* Cargo.lock

* fmt and unused imports

* fmt

* Add license information to consensus/fast-sync/Cargo.toml

Co-authored-by: Boog900 <boog900@tutanota.com>

* Order imports in consensus/fast-sync/src/create.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

* beautify hex generation function & fmt

* Reorder imports consensus/fast-sync/src/fast_sync.rs
2024-06-09 14:24:44 +01:00

8 lines
215 B
Rust

use sha3::{Digest, Keccak256};
pub type BlockId = [u8; 32];
pub type HashOfHashes = [u8; 32];
pub fn hash_of_hashes(hashes: &[BlockId]) -> HashOfHashes {
Keccak256::digest(hashes.concat().as_slice()).into()
}