jacoelho / banking

Banking library
MIT License
2 stars 1 forks source link

Fails to validate some DK iban #45

Closed minlau closed 2 years ago

minlau commented 2 years ago

DK0206715394960066 iban is considered invalid. Error I receive is: incorrect checksum: validation error

package main

import (
    "fmt"
    "log"

    "github.com/jacoelho/banking/iban"
)

func main() {
    err := iban.Validate("DK0206715394960066")
    if err != nil {
        log.Fatal(err)
    } else {
        fmt.Println("valid!")
    }
}

For example: https://bank.codes/iban/validate/ or https://github.com/jbub/banking considers it valid.

Library version: v1.1.37 (latest as of now)

Bonus: during testing of this lib I found that from 350k unique ibans 3500 were falsely invalid.

jacoelho commented 2 years ago

Thank you for reporting.

Sounds like an issue calculating the mod97-10, going to investigate.

jacoelho commented 2 years ago

@minlau could try running your tests with version v1.2.0?

is your iban set public? happy to add as fixtures

minlau commented 2 years ago

Just tested it on 350k ibans - works good now. Sorry, but iban set is not public.