Skip to main content

int_from_be_bytes

Function int_from_be_bytes 

Source
pub open spec fn int_from_be_bytes(bytes: Seq<u8>) -> int
Expand description
{
    let unsigned = nat_from_be_bytes(bytes);
    if sign_bit_set(bytes[0]) {
        unsigned as int - pow(256, bytes.len()) as int
    } else {
        unsigned as int
    }
}