Skip to main content

pack

Pack data into hex string with little endian format.

def pack(
structure: string,
data: tuple
) - > bytes

Pack data into hex string with little endian format.

Parameters

NameTypeDescription
structurestringThe format string using standard struct module syntax that defines the layout of the data
datatupleA sequence of values to be packed into the byte string according to the specified structure

Returns

TypeDescription
bytesA byte string containing the packed data formatted according to the little-endian structure string