2.2.7.2 BitsHex


Name

BitsHex

Remark

This Class can be used to compress byte vectors (1 and 0) to hex strings, and to decompress hex strings back to byte vectors.

Note: Since it converts every 4 bits to a hex char, so if there is less than 4 bits, 0's will be filled in. For example {1,0,1,0,1,1} will be converted to "AC", because 1010=10=A, and 1100=12=C, notice that two 0's are filled at the end in "1100". "AC" will be decompressed to {1,0,1,0,1,1,0,0}.

Hierarchy

  • BitsHex

Examples

Header to Include

origin.h

Reference

Members

Name Brief Example
BitsToHexStr convert a vector of 1's and 0's to a hex string Examples
HexStrToBits convert a hex string to a vector of 1's and 0's Examples
vector_out a little utility function to print out byte vector Examples