decodeUint64 static method

BigInt decodeUint64(
  1. Uint8List encoded
)

Implementation

static BigInt decodeUint64(Uint8List encoded) {
  if (encoded.length != UINT64_LENGTH) {
    throw ArgumentError('Length of byte array is invalid');
  }

  var result = BigInt.from(0);
  for (var i = 0; i < encoded.length; i++) {
    result += BigInt.from(encoded[encoded.length - i - 1]) << (8 * i);
  }
  return result;
}