makeVersionInfoBits static method

void makeVersionInfoBits(
  1. Version version,
  2. BitArray bits
)

Implementation

static void makeVersionInfoBits(Version version, BitArray bits) {
  bits.appendBits(version.versionNumber, 6);
  final bchCode = calculateBCHCode(version.versionNumber, _versionInfoPoly);
  bits.appendBits(bchCode, 12);

  if (bits.size != 18) {
    // Just in case.
    throw WriterException('should not happen but we got: ${bits.size}');
  }
}