Question

What is the method to convert hex numbers to text. For example 54 68 6f 6d 61 73 in text could be Thomas. I think I am mis-conceptualizing hex decimals with binaries and how they work.

Was it helpful?

Solution

From powershell I find it like this. Hint, I used the [Char]acter and Convert .NET classes.

$1=[Char][Convert]::ToUInt32('54',16)
$2=[Char][Convert]::ToUInt32('68',16)
$3=[Char][Convert]::ToUInt32('6f',16)
$4=[Char][Convert]::ToUInt32('6d',16)
$5=[Char][Convert]::ToUInt32('61',16)
$6=[Char][Convert]::ToUInt32('73',16)

$1+$2+$3+$4+$5+$6

Result

Thomas

In case you want to manipulate any other formats, find the syntax here.

http://msdn.microsoft.com/en-us/library/system.convert%28v=vs.110%29.aspx

OTHER TIPS

The main idea here (and I think this is what you’re asking) is that each Unicode symbol in the text is represented using its code point value, in hexadecimal notation.

For example, the symbol a is U+0061 LATIN SMALL LETTER A as per the Unicode standard, so you could represent it as 0x61 or 61 in hex.

This works well for ASCII symbols. For higher code points, it depends on the representation. For example, the list of hexadecimal digits could refer to the UTF-8-encoded form of the string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top