readLittleEndianUnsigned static method

BigInt readLittleEndianUnsigned(
  1. ByteBuffer buffer, [
  2. int bytes = 8
])

Reads little-endian unsigned values from a buffer

Implementation

static BigInt readLittleEndianUnsigned(ByteBuffer buffer, [int bytes = 8]) {
  final temp = Uint8List(bytes);
  buffer.get(temp);
  BigInt value = BigInt.zero;
  for (int i = bytes - 1; i >= 0; i--) {
    value = (value << 8) | BigInt.from(temp[i]);
  }
  return value;
}