Описание тега pack
A function in several scripting languages for packing data, creating a sequence of specifically ordered and aligned bytes, into a binary structure. The opposite of the `unpack` function. This tag should be used with a programming language tag as well. While also used as a directive or pragma in some compilers to cause the compiler to ignore standard variable alignment for data aggregates (i.e. struct), do not use this tag for posts on that subject.
The pack
function combines several high-level variables into a single low-level binary representation that usually matches the machine-level representation that you would see in a C struct
. The inverse operation is unpack.
Most versions of pack
and unpack
functions use a format or template that specifies the byte by byte layout of the data being put into or copied out of the memory area containing the binary representation.
Documentation: