pub fn calculate_difficulty(target: &U256) -> U256 {
    let mut arr: [u8; 28] = Default::default();
    arr[0] = 0xff;
    arr[1] = 0xff;
    let diff_one_target = U256::from_big_endian(&arr);
    diff_one_target / target
}
/// Calculate difficulty from the difficulty 1 target and current target.
/// Difficulty 1 is 0x1d00ffff on mainnet and testnet.
///
/// # Arguments
///
/// * `target` - The current target
Calculate difficulty from the difficulty 1 target and current target.
Difficulty 1 is 0x1d00ffff on mainnet and testnet.
Calculate difficulty from the difficulty 1 target and current target . Difficulty 1 is 0x1d00ffff on mainnet and testnet .
pub fn calculate_difficulty(target: &U256) -> U256 {
    let mut arr: [u8; 28] = Default::default();
    arr[0] = 0xff;
    arr[1] = 0xff;
    let diff_one_target = U256::from_big_endian(&arr);
    diff_one_target / target
}
pub fn calculate_difficulty ( target : & U256 ) -> U256 { let mut arr : [ u8 ; 28 ] = Default :: default ( ) ; arr [ 0 ] = 0xff ; arr [ 1 ] = 0xff ; let diff_one_target = U256 :: from_big_endian ( & arr ) ; diff_one_target / target }
Calculate difficulty from the difficulty 1 target and current target.
Calculate difficulty from the difficulty 1 target and current target .
target
&U256
target
&U256