项目作者: Lucien

项目描述 :
Swift Library for validation and generation of CPF and CNPJ numbers.
高级语言: Swift
项目地址: git://github.com/Lucien/fazendinha.git
创建时间: 2017-04-21T19:33:09Z
项目社区:https://github.com/Lucien/fazendinha

开源协议:

下载


Nada a Declarar

Swift Library for validation and generation of CPF and CNPJ numbers 🇧🇷.

NadaADeclarar

Features

  • CPF validation
  • CPF generation
  • CNPJ validation
  • CNPJ generation
  • Accepts plain or masked number as input.
  • CPF has information about the fiscal region and brazilian states associated.
  • CNPJ shows if the number is from a company headquarters (0001 before the verification digits).

Usage

Validation

  1. do {
  2. let cpf = try CPF(number: "51135733961")
  3. cpf.isValid() // true
  4. } catch Parser.InputError.invalidFormat {
  5. print("invalid CPF format")
  6. }

Generation

  1. let cpf = CPF.generate()

Badges

Swift CodeQL SwiftLint