checkSumModulo11 method

String checkSumModulo11(
  1. String data
)

Calculate the Checksum using a modulo 11

Implementation

String checkSumModulo11(String data) {
  var sum = 0;
  var pos = 10;
  for (var c in data.codeUnits) {
    sum += (c - 0x30) * pos;
    pos--;
  }
  return String.fromCharCode(11 - (sum % 11) + 0x30);
}