places ishex() and other helper functions into common.[ch]