Skip to content

Create cnpj-dv (check digits) #25

@juliolmuller

Description

@juliolmuller

Create a new package cnpj-dv to calculate check digits (dígitos verificadores) for CNPJ. Although the logic of calculating these numbers are already implemented inside cnpj-gen, these should be removed from that in the next major version in favor of this package.

  • Create a class CnpjCheckDigits to lazyly calculate first and second checkdigits. The base CNPJ for the calculation should be passed to the constructor and validated accordingly:
    • CNPJ provided should have between 12 and 14 digits after sanitization. Throw error if not met.
    • CNPJ should be provided as string, list of strings or list of integers.
  • The package should support the new alphanumeric format for CNPJ (Create cnpj-dv (check digits) #25).
  • All errors thrown by the package should be custom, prefixed with CnpjCheckDigits*TypeError for type errors and CnpjCheckDigits*Exception for other exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions