django/django-localflavor — pull request #131 by intgr (2014-12-01 13:53:27+00:00)
Title: IBANValidator: Various checksum improvements

I found three things to quibble about in the checksum implementation, here is the PR.

It always bothered me when people write checksum code in such "magic" fashion, comparing the end result with a constant, rather than calculating what the check digit actually should be. In this case it's an actual bug: checksum values '00', '01' and '99' can never occur in valid IBAN numbers, but previously the value 'EE012200221111099080' for example was accepted.

3rd commit refactors the checksum out into a separate method, I found that useful when converting legacy Estonian account numbers to IBAN format. This builds on changes made in the 1st commit.

@benkonrath told me to send this PR here instead of django-iban.