How do i convert a value given as a hexadecimal string to an Octal format, when the number is too large to fit in a 64 bits number?
I currently convert a byte array to hex like this
Byte[] data = { 116, 4, 228, 18, 189, 145, 31, 7, 123, 74, 174, 151, 54, 144, 224, 49, 210, 169, 43, 213 };
hex = BitConverter.ToString(data).Replace("-", string.Empty);
Output in Hex:
7404E412BD911F077B4AAE973690E031D2A92BD5
How do I get the Octal representation?
So i tried this earlier, but it doesn't work.
string binaryval = "";
binaryval = Convert.ToString(Convert.ToInt32(hexValue,16), 8);
foreach (char ch in hexValue)
{
binaryval += Convert.ToString(Convert.ToInt32(ch.ToString(), 16), 8);
}