checkMod1110 function

bool checkMod1110(
  1. String toCheck,
  2. num control
)

Mod 11/10 check

@ignore

Implementation

bool checkMod1110(String toCheck, num control) {
  int nr = 10;
  for (int index = 0; index < toCheck.length; index++) {
    nr += int.parse(toCheck[index], radix: 10);
    if (nr % 10 != 0) {
      nr = nr % 10;
    }
    nr = nr * 2;
    nr = nr % 11;
  }
  return control == (11 - nr == 10 ? 0 : 11 - nr);
}