Skip to content
New issue

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

Faker::Bank.routing_number sometimes generates routing number with wrong checksum #1561

Closed
przemyslaws-iRonin opened this issue Mar 5, 2019 · 0 comments · Fixed by #1563
Closed

Comments

@przemyslaws-iRonin
Copy link

Faker::Bank.routing_number allows to generate invalid routing number. Below I put results of small experiment:

[8] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[9] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[10] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[11] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[12] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[13] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[14] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true, false]
[15] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[16] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[17] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[18] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true]
[19] pry(main)> [*0..100].map { Faker::Bank.send(:checksum, Faker::Bank.routing_number) }.uniq
=> [true, false]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant