You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aren't the two parts self.numeric % 97 != 1 and checksum_algo.validate([self.bban, self.country_code], self.checksum_digits) doing exactly the same check ?
The only difference I see is that for the first condition, many random types of iban generation could lead to obtaining one with 1 as the remainder of modulo 97, whereas in the second condition we explicitly check that the remainder was obtained with the proper iso7064 calculation method.
Am I right ? Would it be correct to keep only the second part of the if condition and get rid of the first part ? Or am I missing something ?
Thanks
The text was updated successfully, but these errors were encountered:
I just run the full test suite as is: all green.
Then I removed the first condition: all green.
Then I put back the first condition and remove the second one: all green.
I didn't hit the case you were guessing about.
Any other insight on this ?
Not that this is very important actually, it's just for my comprehension of the code.
I felt that the two conditions were redundant and wanted to make sure whether I was right or wrong.
Hello :)
Quick question please.
In the code of function
IBAN._validate_iban_checksum()
, located at this permalink:schwifty/schwifty/iban.py
Line 239 in 1b66427
I am wondering about the
if
condition:Aren't the two parts
self.numeric % 97 != 1
andchecksum_algo.validate([self.bban, self.country_code], self.checksum_digits)
doing exactly the same check ?The only difference I see is that for the first condition, many random types of iban generation could lead to obtaining one with 1 as the remainder of modulo 97, whereas in the second condition we explicitly check that the remainder was obtained with the proper iso7064 calculation method.
Am I right ? Would it be correct to keep only the second part of the
if
condition and get rid of the first part ? Or am I missing something ?Thanks
The text was updated successfully, but these errors were encountered: