Описание тега unpack

A function in several scripting languages for unpacking binary data into native types for the language in question. The opposite of the 'pack' function. For the Python concept, use 'iterable-unpacking'. This tag should be used with a programming language tag as well. While also used as directive or pragma in some compilers to ignore standard variable alignment for data aggregates (i.e. struct), do not use this tag for posts on that subject.

The unpack function parses a binary string into several variables with types that are native to the language in question. The binary string usually matches the machine-level representation that you would see in a C struct. The inverse operation is pack.

For Python use iterable-unpacking.

Most versions of unpack and pack functions use a format or template that specifies the byte by byte layout of the data being copied out of or put into the memory area containing the binary representation.

Both functions allow the use of C or C++ routines with complex data structures to be used with the scripting language in order to improve application performance or to perform operations and actions not available in the scripting language.

Documentation: