Hex And Text

From time to time you might have to convert strings to hex or vice versa:

HexToText←{
     a←16|'123456789ABCDEF0123456789abcdef'⍳⍵
     a←{⍵⍴⍨2,⍨0.5×⍴⍵}a
     a←16⊥⍉a
     {⍵{(⍺{⍵⍴(⍵÷⍴⍺)↑1}⍴⍵)/⍵}82 ⎕DR ⍵}a
 }

And the other way around:

TextToHex←{
     a←83 ⎕DR ⍵
     a←1+,⍉16 16⊤a
     '0123456789ABCDEF'[a]
 }


CategoryDyalogUtils