validateVerhoeff static method

bool validateVerhoeff(
  1. String num
)

Implementation

static bool validateVerhoeff(String num) {
  int c = 0;
  List<int> myArray = stringToReversedIntArray(num);
  for (int i = 0; i < myArray.length; i++) {
    c = d[c][p[(i % 8)][myArray[i]]];
  }

  return (c == 0);
}