Hex string to long method.