Function bitcoin_internals::compact_size::decode_unchecked
source · pub fn decode_unchecked(slice: &mut &[u8]) -> u64
Expand description
Gets the compact size encoded value from slice
and moves slice past the encoding.
Caller to guarantee that the encoding is well formed. Well formed is defined as:
- Being at least long enough.
- Containing a minimal encoding.
§Panics
- Panics in release mode if the
slice
does not contain a valid minimal compact size encoding. - Panics in debug mode if the encoding is not minimal (referred to as “non-canonical” in Core).