move char2hex functions to libs