cleaned up hex conversion and added isHexString()