I mean how can I convert my hexadecimal values to biginteger ?
for example i use this :
string value="A1";
BigInteger bi=new BigInteger(value,16);
bi =161; this is true? So how can I convert back it to "A1"?
thanks..
I mean how can I convert my hexadecimal values to biginteger ?
for example i use this :
string value="A1";
BigInteger bi=new BigInteger(value,16);
bi =161; this is true? So how can I convert back it to "A1"?
thanks..
String.Format
supports this:
String.Format("0:x", 161);
Working example:
string value="A1";
BigInteger bi = BigInteger.Parse(value, NumberStyles.HexNumber);
string newVal = string.Format("{0:x}", bi);
//newVal is a1
UPDATE:
The above suggestion is valid for the BigInteger
implementation in the System.Numerics
namespace of .NET
To convert back the BigInteger to hexadecimal string you can do in this way :
string value= bi.ToString("X");