[][src]Module validbr::cnpj

Cnpj utility functions

CNPJ

This module provides utility for constructing and manipulating CNPJ, as well as validating CNPJs. If a CNPJ was successfully constructed with Cnpj::new or Cnpj::parse_str it means that the CNPJ is valid.

Structs

Branch

Struct object used to generate random Cnpj based in provided Branch::0 instead of generating a random branch digit.

InvalidBranchNumber

When branch number is not in the range of 0..=9999.

Enums

CnpjCreationError
DigitCalculationError

Functions

calculate_verifier_digit

Calculates the verifier digit given input [cnpj_digits].

calculate_verifier_digits

Calculate both first and second verifier digits, given the [digits] input.

get_multiplier_values

Calculates the multiplier values for CNPJ verifier digit calculation given the [amount] of digits.