Function bsn1::contents::from_integer[][src]

pub fn from_integer<T>(val: T) -> impl AsRef<[u8]> where
    T: PrimInt
Expand description

Serializes integer as contents octets.

Type T should be the builtin primitive integer types (e.g., u8, u32, isize, i128, …)

This function is common for BER, DER, and CER.

Wargnings

This function assumes that the CPU adopts 2’s complement to represent negative value.