hex numeric implementation