I suppose that getchar/setchar isn't appropriate here, cause character "9"
would be "39" in hex", while "9" in hex" is a "horizontal tab".
That's how Justin's str2hex function works, picking character by character, converting them in hex and putting into the new string.
This function works fine for displaying data on the screen as characters, but not for direct numbers conversion like this: