Skip to content

Conversation

KelvinDiasMoreira
Copy link

@KelvinDiasMoreira KelvinDiasMoreira commented Apr 2, 2025

Description

Added a function to validate CPF numbers in src/lib/isCPF.js, ensuring they comply with the official validation algorithm. The function checks if the CPF has 11 numeric digits and if the verification digits are correctly calculated.

References

The validation follows the rules defined by the Brazilian Federal Revenue Service for CPF verification digit calculation.

Files Changed

  • src/lib/isCPF.js – Added the CPF validation function
  • test/validators.test.js – Added unit tests

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

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 this pull request may close these issues.

2 participants