MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / InternalHexCharToUintn

Function InternalHexCharToUintn

MdePkg/Library/BaseLib/String.c:613–624  ·  view source on GitHub ↗

Convert a Unicode character to numerical value. This internal function only deal with Unicode character which maps to a valid hexadecimal ASII character, i.e. L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other Unicode character, the value returned does not make sense. @param Char The character to convert. @return The numerical value converted. **/

Source from the content-addressed store, hash-verified

611
612**/
613UINTN
614EFIAPI
615InternalHexCharToUintn (
616 IN CHAR16 Char
617 )
618{
619 if (InternalIsDecimalDigitCharacter (Char)) {
620 return Char - L'0';
621 }
622
623 return (10 + CharToUpper (Char) - L'A');
624}
625
626/**
627 Check if a Unicode character is a hexadecimal character.

Callers 4

StrHexToUintnSFunction · 0.70
StrHexToUint64SFunction · 0.70
StrHexToBytesFunction · 0.70
StrHexToUint64Function · 0.70

Calls 2

CharToUpperFunction · 0.85

Tested by

no test coverage detected