Function bitcoin_internals::compact_size::encoded_size

source ·
pub fn encoded_size(value: impl ToU64) -> usize
Expand description

Returns the number of bytes used to encode this CompactSize value.

§Returns

  • 1 for 0..=0xFC
  • 3 for 0xFD..=(2^16-1)
  • 5 for 0x10000..=(2^32-1)
  • 9 otherwise.