Create BigInteger from a byte array in CSharp
Description
The following code shows how to create BigInteger from a byte array.
Example
/* www . j a v a 2 s. co m*/
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
byte[] bytes = { 5, 4, 3, 2, 1 };
BigInteger number = new BigInteger(bytes);
Console.WriteLine("The value of number is {0} (or 0x{0:x}).", number);
}
}
The code above generates the following result.