Yeah... at this point we know that it's either hex or base64, so an explicit check wouldn't be too bad.