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

Cached cctype results in non-random data #24

Open
codingconcepts opened this issue May 24, 2023 · 1 comment
Open

Cached cctype results in non-random data #24

codingconcepts opened this issue May 24, 2023 · 1 comment

Comments

@codingconcepts
Copy link

Issue: The first time faker.CCType() is called, the value is internally cached, meaning subsequent calls will always return the same data:

var cacheCreditCard string

Fix: Remove the caching to ensure subsequent calls are sufficiently random.

@unrealhoang
Copy link

also this will result in data race issue if multiple faker.CCType() being called for the first time in parallel

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

No branches or pull requests

2 participants