Convert an array of bytes into one decimal number as a string
- by Martin Kirsche
I'm trying to write function that converts an arbitrary large array of bytes (larger than 64-bit) into a decimal number represented as string in c# and I simply can't figure out how to do it.
For example the following code ...
Console.WriteLine(ConvertToString(
new byte[]
{
0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00
}));
.. should print out
22774453838368691933757882222884355840
I don't want to just use an extra library like biginteger for that, because I want it to be simple and like to understand how it works.