Add a readnum() variant for hex