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

Brazil tax ID numbers #3414

Open
0bvim opened this issue Feb 27, 2025 · 5 comments
Open

Brazil tax ID numbers #3414

0bvim opened this issue Feb 27, 2025 · 5 comments
Labels
c: feature Request for new feature s: waiting for user interest Waiting for more users interested in this feature

Comments

@0bvim
Copy link

0bvim commented Feb 27, 2025

Clear and concise description of the problem

In Brazil in common use fake CPF and RG while testing and so forth. This are documents like TaxID.
Is a easy algo to implement to generate both and can be very helpful!

Suggested solution

Just implement the algorithm to generate this and others known documents around the world!

Alternative

No response

Additional context

No response

@0bvim 0bvim added c: feature Request for new feature s: pending triage Pending Triage s: waiting for user interest Waiting for more users interested in this feature labels Feb 27, 2025
Copy link
Contributor

Thank you for your feature proposal.

We marked it as "waiting for user interest" for now to gather some feedback from our community:

  • If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
  • If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.

We will start the implementation based on:

  • the number of votes (:+1:) and comments
  • the relevance for the ecosystem
  • availability of alternatives and workarounds
  • and the complexity of the requested feature

We do this because:

  • There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
  • Every feature we add to faker has "costs" associated to it:
    • initial costs: design, implementation, reviews, documentation
    • running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

View more issues which are waiting for user interest

@matthewmayer matthewmayer changed the title Implement Faker Documents Brazil tax ID numbers Feb 27, 2025
@matthewmayer
Copy link
Contributor

matthewmayer commented Feb 27, 2025

In Brazil the CPF (Cadastro de Pessoas Físicas) is an 11‐digit taxpayer identification number with 2 checkdigits
https://en.wikipedia.org/wiki/CPF_number

and RG is used on national identity cards https://en.wikipedia.org/wiki/Brazilian_identity_card

@matthewmayer
Copy link
Contributor

matthewmayer commented Feb 27, 2025

The more generic solution would be something like a https://en.wikipedia.org/wiki/National_identification_number which could implement for different locales. But there would likely be a fair amount of custom code for things like checkdigits.

@0bvim
Copy link
Author

0bvim commented Feb 27, 2025

The more generic solution would be something like a https://en.wikipedia.org/wiki/National_identification_number which could implement for different locales. But there would likely be a fair amount of custom code for things like checkdigits.

In this case generic is a good option too, but I will continue to need of this specific implementation and should be one for each country but can be implemented on demand.

I can try it, for now I'm with short time, but I can try implement it here.

@matthewmayer
Copy link
Contributor

We normally wait until an issue has 10 upvotes in the "waiting for user interest" before we consider it for inclusion. If you can share any code snippets from a custom implementation that will definitely help in the future. You can probably use a mix of existing faker helper / string methods, plus some custom code for the checkdigits

pseudocode

const base = faker.helpers.replaceSymbols('###.###.###-') //'856.032.749-'
const checkdigits = calculateCheckDigitsForCPF(base)
const cpf = base+checkdigits

@xDivisionByZerox xDivisionByZerox removed the s: pending triage Pending Triage label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature s: waiting for user interest Waiting for more users interested in this feature
Projects
None yet
Development

No branches or pull requests

3 participants