I need to parse a hexadecimal value to base 10 long integer. Value is something like:
9F2EEA4AA03D55B33172E9A86CFF6156AC1628C67983193A337B98995151F9B0F41562290DB98697280E805803E4B18914519CEB55CEA5D03A927C28C36A4BC7
How can i do this?
UPDATE:
In python, i used following:
>> num = "9F2EEA4AA03D55B33172E9A86CFF6156AC1628C67983193A337B98995151F9B0F41562290DB98697280E805803E4B18914519CEB55CEA5D03A927C28C36A4BC7"
>> int(num, 16)
>> 8337103942674051648235321365669510487642415361796636721089378763661406518267124809778145800381557738780272231500412167743930433352841689114003303823985607L
when my colleague tries @Sergey’s answer, my colleague get a different result (a negative value while mine is not a negative one)
>> BigInteger bigInteger = BigInteger.Parse(num, NumberStyles.HexNumber);
>> -5070703987268545451338703632536335639836950458795756656634182680060357511806422167023728497785345688909759626686073883109823449459104880832430345182098489
Please take a look at BigInteger Structure to work with large integers.
Update
Prepend (start) the string with 0 if the number should be interpreted as positive even if its first character is 8–F. See the example above:
0D574...