decodeBigInt function

BigInt decodeBigInt(
  1. List<int> bytes
)

Decode a BigInt from bytes in big-endian encoding.

Implementation

BigInt decodeBigInt(List<int> bytes) {
  BigInt result = new BigInt.from(0);
  for (int i = 0; i < bytes.length; i++) {
    result += new BigInt.from(bytes[bytes.length - i - 1]) << (8 * i);
  }
  return result;
}