Module bitcoin_internals::compact_size

source ·
Expand description

Variable length integer encoding A.K.A CompactSize.

An integer can be encoded depending on the represented value to save space. Variable length integers always precede an array/vector of a type of data that may vary in length.

Constants§

  • The maximum size of a serialized object in bytes or number of elements (for eg vectors) when the size is encoded as CompactSize.

Functions§

  • Gets the compact size encoded value from slice and moves slice past the encoding.
  • Encodes CompactSize without allocating.
  • Returns the number of bytes used to encode this CompactSize value.