I have a list of integers, say L which contains the binary representation of a number. Each integer in the list L can be 0 or 1. The "least significant bit" is on the left (not on the right).
Example: 1000001111 for the (decimal) number 961, or 0111010001 for 558.
I want to convert the list into a Biginteger.
I have tried the following so far:
Dim bytes(L.Count - 1) As Byte
For i As Integer = 0 to L.Count - 1
bytes(i) = CByte(L(i))
Next
Dim Value As New BigInteger(bytes)
Return Value
but the result is completely wrong. Can anyone help to make this conversion? c# of vb.net examples are equally perfect.
I have also looked into something like the following taken from a question here:
Buffer.BlockCopy(intArray, 0, byteArray, 0, byteArray.Length);
but still with no success with the Biginteger conversion.