Restrict hex input for extra perf.