Console app :
BigInteger tst = 128;
byte[] buffer = tst.ToByteArray();
foreach (byte b in buffer)
Console.WriteLine(b);
Console.Read();
Result :
128
0
Why BigInteger ToByteArray method sometime generate this extra byte ? I tried that on version 4.7.2 & 4.5.2 of the .Net Framework, same result. Any clue is welcome, you may need System.Numerics reference to compile this code. thx