Function pgp::types::mpi

source ·
pub fn mpi(input: &[u8]) -> IResult<&[u8], MpiRef<'_>, Error>
Expand description

Parse Multi Precision Integers Ref: https://tools.ietf.org/html/rfc4880.html#section-3.2

§Examples

use pgp::types::mpi;

// Decode the number `1`.
assert_eq!(
    mpi(&[0x00, 0x01, 0x01][..]).unwrap(),
    (&b""[..], (&[1][..]).into())
);