as suggested by Guillaume Englert, drop alt flag all together and pre-convert hex string to int