cpf-0.1.0 has been yanked.
CPF
Brazilian CPF parsing, validating and formatting library.
use CPF;
// If all you need is validating a CPF number, use the `valid` function:
assert!;
// For formatting and additional metadata from the number, parse into the CPF struct:
let cpf: CPF = "38521139039".parse.unwrap;
assert_eq!;
assert_eq!;
no_std support
The library can be used on no_std environments by disabling the std flag:
[]
= { = "0.1", = false }
Random CPF generation support
The rand feature flag enables random CPF generation:
[]
= { = "0.1", = ["rand"] }
= "0.8"
use CPF;
use rand;
use Rng;
let cpf: CPF = thread_rng.gen;