kkempin / exiban

Elixir library for validation and manipulating IBAN bank account numbers.
MIT License
10 stars 11 forks source link

[Be Aware] Wrong IBAN Validations #10

Closed rubas closed 1 month ago

rubas commented 1 year ago

Use the test IBANs from https://www.iban.com/testibans, I noticed that the library is not validating IBAN correctly.

     invalid_ibans = ~w(
        GB94BARC20201530093459
        GB96BARC202015300934591
        GB02BARC20201530093451
        GB68CITI18500483515538
        GB24BARC20201630093459
        GB12BARC20201530093A59
        GB78BARCO0201530093459
        GB2LABBY09012857201707
        GB01BARC20714583608387
        GB00HLFX11016111455365
        US64SVBKUS6S3300958879
      )

      Enum.each(invalid_ibans, fn iban ->
        iban
        |> ExIban.valid?()
        |> IO.inspect()
      end)
false
false
true
true
true
false
false
true
true
true
rubas commented 1 year ago

https://en.wikipedia.org/wiki/International_Bank_Account_Number#National_check_digits