cpf/generator

Functions

pub fn generate(formatted: Bool) -> String

Generates a Brazilian CPF (Cadastro de Pessoas Físicas) number.

A CPF is an 11-digit number used for tax purposes in Brazil. This function generates a valid CPF number, optionally formatted with punctuation.

Args:

  • formatted (Bool): If True, the generated CPF will be formatted with punctuation (e.g., “123.456.789-09”). If False, the CPF will be a plain string of digits (e.g., “12345678909”).

Returns:

  • String: The generated CPF number, optionally formatted.
Search Document