decodeBytesToUint static method

BigInt decodeBytesToUint(
  1. Uint8List encoded
)

Converts a Uint8List byte buffer into a BigInt

Implementation

static BigInt decodeBytesToUint(Uint8List encoded) {
  var result = BigInt.zero;

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