Instance Property
compactSizePrefix
The data prefixed with a Bitcoin-style compact-size integer encoding the byte count.
var compactSizePrefix: Data { get }
Discussion
Compact-size (aka CompactSize / VarInt) is the variable-length integer encoding Bitcoin Core uses for serialized wire formats (src/serialize.h). The encoding is not the same as the Protobuf varint or SQLite varint — it uses a fixed prefix byte to indicate width:
1 byte for lengths 0–252 (the length byte itself)
3 bytes (0xfd + little-endian UInt16) for 253–65535
5 bytes (0xfe + little-endian UInt32) for 65536–4_294_967_295
9 bytes (0xff + little-endian UInt64) for the full 64-bit range