getTotalDataBits static method

int getTotalDataBits(
  1. int typeNumber,
  2. QrErrorCorrectLevel errorCorrectLevel
)

Implementation

static int getTotalDataBits(
  int typeNumber,
  QrErrorCorrectLevel errorCorrectLevel,
) {
  final List<int> rsBlock = _getRsBlockTable(typeNumber, errorCorrectLevel);
  final int length = rsBlock.length ~/ 3;
  int totalDataBits = 0;
  for (int i = 0; i < length; i++) {
    final int count = rsBlock[i * 3 + 0];
    final int dataCount = rsBlock[i * 3 + 2];
    totalDataBits += count * dataCount * 8;
  }
  return totalDataBits;
}