BitBtoX
The BitBtoX function converts a binary string representation to a hexadecimal string representation.
sHex = BitBtoX( sBinary ) where |
sHex is a hexadecimal string representation of a number.
sBinary is the binary string representation of a number.
The binary and hexadecimal string representations both have the lowest-order bit at the right end of the string. The function does not care whether the string contains leading zeros for the highest order bits that are not set.
The following script converts a binary string representation to a hexadecimal string representation..
|
-- pick a number |
|
-- convert to a decimal number |
|
-- prints 100101 binary --> 00000025 hex |