checkBelgianBBAN function

bool checkBelgianBBAN(
  1. String bban
)

Used for Belgian BBAN check

@ignore

Implementation

bool checkBelgianBBAN(String bban) {
  final String stripped = bban.replaceAll(RegExp(r'[\s.]+'), '');
  final int checkingPart =
      int.parse(stripped.substring(0, stripped.length - 2), radix: 10);
  final int checksum = int.parse(
      stripped.substring(stripped.length - 2, stripped.length),
      radix: 10);
  final int remainder = checkingPart % 97 == 0 ? 97 : checkingPart % 97;

  return remainder == checksum;
}