mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-25 15:10:46 +00:00
const pda
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user