Convert HEX representation to integer