Search code examples
unicodebinaryhexbinaries

Hex Numbers to Text


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.


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