We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func Test_BankCard(t *testing.T) { gtest.C(t, func(t *gtest.T) { rule := "bank-card" val1 := "6230514630000424470" val2 := "6230514630000424473" // this bocom card valid result is already true and error is nil val3 := "60142870670591508" err1 := g.Validator().Data(val1).Rules(rule).Run(ctx) err2 := g.Validator().Data(val2).Rules(rule).Run(ctx) err3 := g.Validator().Data(val3).Rules(rule).Run(ctx) t.AssertNE(err1, nil) t.Assert(err2, nil) // but no pass t.Assert(err3, nil) }) }
The bank card number of bocom does not fully follow the luhn algorithm and needs to be optimized and adapted.
The text was updated successfully, but these errors were encountered:
Currently I have customized the rules to fit older bank card numbers, and this issue can be closed directly.
Sorry, something went wrong.
No branches or pull requests
The bank card number of bocom does not fully follow the luhn algorithm and needs to be optimized and adapted.
The text was updated successfully, but these errors were encountered: