Encodes a number into a variable-length byte array according to the Bitcoin protocol. This format is used for encoding lengths of data, such as script lengths.
The number to encode. Can be a NumLike.
The encoded length as a Bytes.
Encodes a number into a variable-length byte array according to the Bitcoin protocol. This format is used for encoding lengths of data, such as script lengths.