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.vehicle.vin() returning an invalid Vin number #319

Closed
demipel8 opened this issue Jan 27, 2022 · 1 comment · Fixed by #320
Closed

faker.vehicle.vin() returning an invalid Vin number #319

demipel8 opened this issue Jan 27, 2022 · 1 comment · Fixed by #320
Assignees
Labels
c: bug Something isn't working p: 1-normal Nothing urgent

Comments

@demipel8
Copy link
Contributor

demipel8 commented Jan 27, 2022

Describe the bug

From time to time the vin generated id 18 characters long. according to the standard a vin number should be 17 characters long.

Looking at the code:

this.faker.datatype.number({ min: 10000, max: 100000 })

This last segment intends to return a 5 digit block but it has an edge case where it returns 100000, making the whole thing 18 chars long.

I will try submitting a PR later.

Reproduction

It's random, if you generate a lot of vin numbers you will end up getting it.

Additional Info

No response

@demipel8 demipel8 added the s: pending triage Pending Triage label Jan 27, 2022
@MilosPaunovic MilosPaunovic added c: bug Something isn't working and removed s: pending triage Pending Triage labels Jan 27, 2022
@MilosPaunovic
Copy link
Member

@demipel8 If you submit a PR, please do provide a test which will create a large number of VINs to make sure it doesn't happen again.

@import-brain import-brain added the p: 2-high Fix main branch label Jan 27, 2022
@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent and removed p: 2-high Fix main branch labels Mar 15, 2022
@Shinigami92 Shinigami92 moved this to In Progress in Faker Roadmap Mar 23, 2022
@Shinigami92 Shinigami92 linked a pull request Mar 23, 2022 that will close this issue
Repository owner moved this from In Progress to Done in Faker Roadmap Mar 28, 2022
@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants