readBytes static method

BigInt readBytes(
  1. Uint8List bytes
)

internal method to convert Unit8List to BigInt

Implementation

static BigInt readBytes(Uint8List bytes) {
  BigInt result = BigInt.zero;

  for (final byte in bytes) {
    // reading in big-endian, so we essentially concat the new byte to the end
    result = (result << 8) | BigInt.from(byte & 0xff);
  }
  return result;
}