1

I need to take a byte array and convert it to a string. I basically need to do the opposite of this:

BigInteger.Parse(num).ToByteArray();

1 Answers1

3

If you have:

string num = "1234567890123456789012345678901234567890";
byte[] bytes = BigInteger.Parse(num).ToByteArray();

and you want to get from the byte[] bytes array back to the string "1234567890123456789012345678901234567890", this is the code that reverses that operation:

string numDecoded = new BigInteger(bytes).ToString();

.NET Fiddle

Lasse V. Karlsen
  • 366,661
  • 96
  • 610
  • 798