max index of hex in string is calculated in htoi