const pda

This commit is contained in:
Hardhat Chad
2024-04-28 16:32:23 +00:00
parent c80e3ac5b3
commit 566bbeb5bf
7 changed files with 95 additions and 64 deletions

View File

@@ -30,18 +30,18 @@ impl fmt::Display for Hash {
}
}
impl Hash {
pub fn difficulty(&self) -> u32 {
let mut count = 0;
for &byte in &self.0 {
let lz = byte.leading_zeros();
count += lz;
if lz < 8 {
break;
}
}
count
}
}
// impl Hash {
// pub fn difficulty(&self) -> u32 {
// let mut count = 0;
// for &byte in &self.0 {
// let lz = byte.leading_zeros();
// count += lz;
// if lz < 8 {
// break;
// }
// }
// count
// }
// }
impl_to_bytes!(Hash);