pub fn extract_target(header: RawHeader) -> U256 {
    let mantissa = U256::from_little_endian(&header[72..75]);
    // We use saturating here to avoid panicking.
    // This is safe because it saturates at `0`, which gives an unreachable target of `1`
    let exponent = header[75].saturating_sub(3);
    let offset = U256::from(256u64).pow(exponent.into());

    mantissa * offset
}
/// Extracts the target from a block header.
///
/// Target is a 256 bit number encoded as a 3-byte mantissa
/// and 1 byte exponent.
///
/// # Arguments
///
/// * `header` - An 80-byte Bitcoin header
Extracts the target from a block header.
Target is a 256 bit number encoded as a 3-byte mantissa
and 1 byte exponent.
Extracts the target from a block header . Target is a 256 bit number encoded as a 3 - byte mantissa and 1 byte exponent .
pub fn extract_target(header: RawHeader) -> U256 {
    let mantissa = U256::from_little_endian(&header[72..75]);
    // We use saturating here to avoid panicking.
    // This is safe because it saturates at `0`, which gives an unreachable target of `1`
    let exponent = header[75].saturating_sub(3);
    let offset = U256::from(256u64).pow(exponent.into());
    mantissa * offset
}
pub fn extract_target ( header : RawHeader ) -> U256 { let mantissa = U256 :: from_little_endian ( & header [ 72 .. 75 ] ) ; // We use saturating here to avoid panicking. // This is safe because it saturates at `0`, which gives an unreachable target of `1` let exponent = header [ 75 ] . saturating_sub ( 3 ) ; let offset = U256 :: from ( 256u64 ) . pow ( exponent . into ( ) ) ; mantissa * offset }
Extracts the target from a block header.
Extracts the target from a block header .
header
RawHeader
header
RawHeader