Decode two hex digit characters into a byte.

Synopsis

Declared in <llvm/ADT/StringExtras.h>

bool
tryGetHexFromNibbles(
    char MSB,
    char LSB,
    uint8_t& Hex);

Description

Store the binary representation of the two provided values, MSB and LSB, that make up the nibbles of a hexadecimal digit. If MSB or LSB do not correspond to proper nibbles of a hexadecimal digit, this method returns false. Otherwise, returns true.

Return Value

True if both characters were valid hex digits.

Parameters

Name

Description

MSB

high nibble as a hex digit character

LSB

low nibble as a hex digit character

Hex

set to the decoded byte on success

Created with MrDocs