in reply to Length of unpacked string for "hex" data
As a side note, and probably displaying my ignorance, I wonder why the "H" specifier deals with nibbles as its basic unit and not bytes. Dealing with "hex" data by the byte would seem to be the far more common operation.
The repeat count pertains to the number of inputs for pack and to the number of outputs for unpack. This is consistent across (almost?) all formats.
For pack 'H', the repeat count translates to nibble count because each character passed to pack 'H' contains one nibble of information. Similarly, For unpack 'H', the repeat count translates to nibble count because each character returned by unpack 'H' contains one nibble of information.
|
|---|