Erlang library

What the Erlang library implements from the shared contract, what fails, and what to do next.

Repository
github.com/brazilian-utils/erlang48dd38d
Package
brutils

Install

{deps, [brutils]}.  % rebar.config

Erlang implements 29 of the 182 contract functions and 12.5% of the core functions. 340 shared cases pass and 352 fail.

Compared with the other libraries

LibraryCore functionsImplementedCases that pass
JavaScript library100%180/1825033
Rust library37.5%132/1821732
Go library35%136/1822081
.NET library32.5%133/1822194
Ruby library27.5%133/1822589
Python library17.5%40/182500
Erlang12.5%29/182340

What to do next

The list starts with failing functions, then wrong signatures, then missing core functions, then the rest. In each group, functions implemented by more libraries come first, since there is more code to port from. Each item is also an issue in the library's repository.

23 functions fail

Show the 23 failing functions
FunctionStatusDetailsImplemented by
CEP: Format
cep.format (core)
fails13 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CEP: Validate
cep.isValid (core)
fails10 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Driver's license (CNH): Validate
cnh.isValid (core)
fails5 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CNPJ: Format
cnpj.format (core)
fails36 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CNPJ: Validate
cnpj.isValid (core)
fails4 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CPF: Format
cpf.format (core)
fails28 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CPF: Validate
cpf.isValid (core)
fails5 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
License plate: Convert to mercosul
licensePlate.convertToMercosul (core)
fails8 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
License plate: Format
licensePlate.format (core)
fails17 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
License plate: Generate
licensePlate.generate (core)
fails4 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
License plate: Get format
licensePlate.getFormat (core)
fails11 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
License plate: Validate
licensePlate.isValid (core)
fails17 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Passport: Format
passport.format
fails17 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Passport: Validate
passport.isValid
fails4 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Phone: Format
phone.format (core)
fails15 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Phone: Generate
phone.generate (core)
fails3 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
PIS/PASEP: Format
pis.format (core)
fails54 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
PIS/PASEP: Validate
pis.isValid (core)
fails6 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
RENAVAM: Validate
renavam.isValid (core)
fails7 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Voter ID: Format
voterId.format (core)
fails26 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
Voter ID: Validate
voterId.isValid (core)
fails18 cases fail6: JavaScript, Python, Go, Ruby, Rust, .NET
CNPJ: Generate
cnpj.generate (core)
fails5 cases fail5: JavaScript, Python, Go, Ruby, .NET
Phone: Validate
phone.isValid (core)
fails39 cases fail5: JavaScript, Go, Ruby, Rust, .NET

153 functions are missing

Show the 153 missing functions
FunctionStatusImplemented by
Currency (BRL): Write out in words
currency.convertToWords (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Currency (BRL): Format
currency.format (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Email: Validate
email.isValid (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Legal nature: Validate
legalNature.isValid (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Legal nature: List
legalNature.list (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Court case number: Format
legalProcess.format (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Court case number: Generate
legalProcess.generate (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Court case number: Validate
legalProcess.isValid (core)
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Boleto: Validate
boleto.isValid (core)
missing5: JavaScript, Go, Ruby, Rust, .NET
CEP: Get address info
cep.getAddressInfo (core)
missing5: JavaScript, Go, Ruby, Rust, .NET
Dates and holidays: Is holiday
date.isHoliday (core)
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: Get description
legalNature.getDescription (core)
missing5: Python, Go, Ruby, Rust, .NET
CEP: Get info by address
cep.getInfoByAddress (core)
missing4: JavaScript, Go, Rust, .NET
Municipalities: Get code by name
municipality.getCodeByName (core)
missing1: JavaScript
Dates and holidays: Write out in words
date.convertToWords
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
States (UF): Get code by name
state.getCodeByName
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
States (UF): Get name by code
state.getNameByCode
missing6: JavaScript, Python, Go, Ruby, Rust, .NET
Area code (DDD): List by state
areaCode.listByState
missing5: JavaScript, Go, Ruby, Rust, .NET
Banks: Get by code
bank.getByCode
missing5: JavaScript, Go, Ruby, Rust, .NET
Banks: Get by ispb
bank.getByIspb
missing5: JavaScript, Go, Ruby, Rust, .NET
Banks: List
bank.list
missing5: JavaScript, Go, Ruby, Rust, .NET
Bank account: Validate
bankAccount.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
Boleto: Format
boleto.format
missing5: JavaScript, Go, Ruby, Rust, .NET
Boleto: Generate
boleto.generate
missing5: JavaScript, Go, Ruby, Rust, .NET
Boleto: Parse
boleto.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CAEPF: Format
caepf.format
missing5: JavaScript, Go, Ruby, Rust, .NET
CAEPF: Validate
caepf.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CAEPF: Parse
caepf.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CBO: Look up
cbo.get
missing5: JavaScript, Go, Ruby, Rust, .NET
CBO: Validate
cbo.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CBO: Parse
cbo.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CEI: Format
cei.format
missing5: JavaScript, Go, Ruby, Rust, .NET
CEI: Validate
cei.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CEI: Parse
cei.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CEP: Parse
cep.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Civil registry certificate: Format
certidao.format
missing5: JavaScript, Go, Ruby, Rust, .NET
Civil registry certificate: Decode
certidao.getInfo
missing5: JavaScript, Go, Ruby, Rust, .NET
Civil registry certificate: Parse
certidao.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CFOP: Look up
cfop.get
missing5: JavaScript, Go, Ruby, Rust, .NET
CFOP: Validate
cfop.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CFOP: Parse
cfop.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CNAE: Format
cnae.format
missing5: JavaScript, Go, Ruby, Rust, .NET
CNAE: Look up
cnae.get
missing5: JavaScript, Go, Ruby, Rust, .NET
CNAE: Validate
cnae.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CNAE: Parse
cnae.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Driver's license (CNH): Format
cnh.format
missing5: JavaScript, Go, Ruby, Rust, .NET
Driver's license (CNH): Generate
cnh.generate
missing5: JavaScript, Go, Ruby, Rust, .NET
Driver's license (CNH): Parse
cnh.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CNO: Format
cno.format
missing5: JavaScript, Go, Ruby, Rust, .NET
CNO: Validate
cno.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CNO: Parse
cno.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CNPJ: Parse
cnpj.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CNS (SUS card): Format
cns.format
missing5: JavaScript, Go, Ruby, Rust, .NET
CNS (SUS card): Validate
cns.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CNS (SUS card): Parse
cns.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
CPF: Parse
cpf.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Payment card: Validate
creditCard.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CSOSN: Validate
csosn.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
CST: Validate
cst.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
Currency (BRL): Parse
currency.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Dates and holidays: Difference in business days
date.differenceInBusinessDays
missing5: JavaScript, Go, Ruby, Rust, .NET
Dates and holidays: Is business day
date.isBusinessDay
missing5: JavaScript, Go, Ruby, Rust, .NET
IBAN: Format
iban.format
missing5: JavaScript, Go, Ruby, Rust, .NET
IBAN: Decode
iban.getInfo
missing5: JavaScript, Go, Ruby, Rust, .NET
IBAN: Validate
iban.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
IBAN: Parse
iban.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: Format
legalNature.format
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: Generate
legalNature.generate
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: Look up
legalNature.get
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: List by category
legalNature.listByCategory
missing5: JavaScript, Go, Ruby, Rust, .NET
Legal nature: Parse
legalNature.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Court case number: Parse
legalProcess.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
License plate: Parse
licensePlate.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Municipalities: Get by code
municipality.getByCode
missing5: JavaScript, Go, Ruby, Rust, .NET
Municipalities: List
municipality.list
missing5: JavaScript, Go, Ruby, Rust, .NET
NCM: Format
ncm.format
missing5: JavaScript, Go, Ruby, Rust, .NET
NCM: Validate
ncm.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
NCM: Parse
ncm.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
NF-e access key: Format
nfeKey.format
missing5: JavaScript, Go, Ruby, Rust, .NET
NF-e access key: Decode
nfeKey.getInfo
missing5: JavaScript, Go, Ruby, Rust, .NET
NF-e access key: Validate
nfeKey.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
NF-e access key: Parse
nfeKey.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Numbers in words: Write out in words
number.convertToWords
missing5: JavaScript, Go, Ruby, Rust, .NET
Passport: Parse
passport.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Phone: Is valid landline
phone.isValidLandline
missing5: JavaScript, Go, Ruby, Rust, .NET
Phone: Is valid mobile
phone.isValidMobile
missing5: JavaScript, Go, Ruby, Rust, .NET
Phone: Is valid service
phone.isValidService
missing5: JavaScript, Go, Ruby, Rust, .NET
Phone: Parse
phone.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
PIS/PASEP: Parse
pis.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Pix key: Decode
pixKey.getInfo
missing5: JavaScript, Go, Ruby, Rust, .NET
Pix key: Validate
pixKey.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
Pix payload (BR Code): Decode
pixPayload.getInfo
missing5: JavaScript, Go, Ruby, Rust, .NET
Pix payload (BR Code): Validate
pixPayload.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
Professional registration: Validate
registroProfissional.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
RENAVAM: Generate
renavam.generate
missing5: JavaScript, Go, Ruby, Rust, .NET
States (UF): Get timezone
state.getTimezone
missing5: JavaScript, Go, Ruby, Rust, .NET
States (UF): List
state.list
missing5: JavaScript, Go, Ruby, Rust, .NET
Text: Capitalize
text.capitalize
missing5: JavaScript, Go, Ruby, Rust, .NET
Text: Remove accents
text.removeAccents
missing5: JavaScript, Go, Ruby, Rust, .NET
VIN (chassis): Validate
vin.isValid
missing5: JavaScript, Go, Ruby, Rust, .NET
Voter ID: Parse
voterId.parse
missing5: JavaScript, Go, Ruby, Rust, .NET
Area code (DDD): Decode
areaCode.getInfo
missing4: JavaScript, Go, Ruby, .NET
Civil registry certificate: Validate
certidao.isValid
missing4: JavaScript, Go, Ruby, Rust
Dates and holidays: Get holidays
date.getHolidays
missing4: JavaScript, Go, Rust, .NET
State registration (IE): Validate
ie.isValid
missing4: JavaScript, Go, Rust, .NET
Pix payload (BR Code): Generate
pixPayload.generate
missing4: JavaScript, Go, Ruby, Rust
States (UF): Get by ibge code
state.getByIbgeCode
missing4: JavaScript, Go, Ruby, .NET
Boleto: Decode
boleto.getInfo
missing3: JavaScript, Go, Ruby
Area code (DDD): Get by municipality code
areaCode.getByMunicipalityCode
missing1: JavaScript
CBO: Format
cbo.format
missing1: JavaScript
CEP: Get state
cep.getState
missing1: JavaScript
CEST: Format
cest.format
missing1: JavaScript
CEST: Look up
cest.get
missing1: JavaScript
CEST: Validate
cest.isValid
missing1: JavaScript
CEST: Parse
cest.parse
missing1: JavaScript
CFOP: Format
cfop.format
missing1: JavaScript
CID-10: Format
cid10.format
missing1: JavaScript
CID-10: Look up
cid10.get
missing1: JavaScript
CID-10: Validate
cid10.isValid
missing1: JavaScript
CID-10: Parse
cid10.parse
missing1: JavaScript
cClassTrib: Look up
classTrib.get
missing1: JavaScript
cClassTrib: Validate
classTrib.isValid
missing1: JavaScript
CNPJ: Decode
cnpj.getInfo
missing1: JavaScript
CPF: Decode
cpf.getInfo
missing1: JavaScript
CST IBS/CBS: Look up
cstIbsCbs.get
missing1: JavaScript
CST IBS/CBS: Validate
cstIbsCbs.isValid
missing1: JavaScript
Dates and holidays: Add business days
date.addBusinessDays
missing1: JavaScript
Dates and holidays: Sub business days
date.subBusinessDays
missing1: JavaScript
GTIN (EAN/UPC): Decode
gtin.getInfo
missing1: JavaScript
GTIN (EAN/UPC): Validate
gtin.isValid
missing1: JavaScript
ISBN: Format
isbn.format
missing1: JavaScript
ISBN: Decode
isbn.getInfo
missing1: JavaScript
ISBN: Validate
isbn.isValid
missing1: JavaScript
ISBN: Parse
isbn.parse
missing1: JavaScript
Court case number: Decode
legalProcess.getInfo
missing1: JavaScript
Municipalities: List by area code
municipality.listByAreaCode
missing1: JavaScript
NBS: Format
nbs.format
missing1: JavaScript
NBS: Look up
nbs.get
missing1: JavaScript
NBS: Validate
nbs.isValid
missing1: JavaScript
NBS: Parse
nbs.parse
missing1: JavaScript
NFS-e access key: Decode
nfseKey.getInfo
missing1: JavaScript
NFS-e access key: Validate
nfseKey.isValid
missing1: JavaScript
NFS-e access key: Parse
nfseKey.parse
missing1: JavaScript
Service list (LC 116): Look up
serviceItem.get
missing1: JavaScript
Service list (LC 116): Validate
serviceItem.isValid
missing1: JavaScript
States (UF): Get capital
state.getCapital
missing1: JavaScript
States (UF): Get regions
state.getRegions
missing1: JavaScript
States (UF): List by region
state.listByRegion
missing1: JavaScript
SUFRAMA registration: Format
suframa.format
missing1: JavaScript
SUFRAMA registration: Generate
suframa.generate
missing1: JavaScript
SUFRAMA registration: Validate
suframa.isValid
missing1: JavaScript
SUFRAMA registration: Parse
suframa.parse
missing1: JavaScript
Voter ID: Decode
voterId.getInfo
missing1: JavaScript

Failing cases

Show the 352 failing cases
CaseExpectedActual
cep.format#[""]""expected "", threw: {error, invalid}
cep.format#["0"]"0"expected "0", threw: {error, invalid}
cep.format#["01"]"01"expected "01", threw: {error, invalid}
cep.format#["010"]"010"expected "010", threw: {error, invalid}
cep.format#["0100"]"0100"expected "0100", threw: {error, invalid}
cep.format#["01001"]"01001"expected "01001", threw: {error, invalid}
cep.format#["010010"]"01001-0"expected "01001-0", threw: {error, invalid}
cep.format#["0100100"]"01001-00"expected "01001-00", threw: {error, invalid}
cep.format#["01001000000000"]"01001-000"expected "01001-000", threw: {error, invalid}
cep.format#["a0.10cr01?00#ab0"]"01001-000"expected "01001-000", threw: {error, invalid}
cep.format#negative-number""expected "", threw: error:function_clause
cep.format#fractional-number""expected "", threw: error:function_clause
cep.format#unsafe-number""expected "", threw: error:function_clause
cep.isValid#["01310-100"]truefalse
cep.isValid#[20040020]truefalse
cep.isValid#[" 01310-100 "]truefalse
cep.isValid#["92.500-000"]truefalse
cep.isValid#["013 10 100"]truefalse
cep.isValid#["01310.100"]truefalse
cep.isValid#["01310/100"]truefalse
cep.isValid#["0131/0100"]truefalse
cep.isValid#["--0131 0100"]truefalse
cep.isValid#["01310/100/"]truefalse
cnh.isValid#valid-sampletruefalse
cnh.isValid#["00000009309"]truefalse
cnh.isValid#["ab00000000119"]falsetrue
cnh.isValid#["00000000119ab"]falsetrue
cnh.isValid#["000000001_19"]falsetrue
cnpj.format#[""]""expected "", threw: {error, invalid}
cnpj.format#["4"]"4"expected "4", threw: {error, invalid}
cnpj.format#["46"]"46"expected "46", threw: {error, invalid}
cnpj.format#["468"]"46.8"expected "46.8", threw: {error, invalid}
cnpj.format#["4684"]"46.84"expected "46.84", threw: {error, invalid}
cnpj.format#["46843"]"46.843"expected "46.843", threw: {error, invalid}
cnpj.format#["468434"]"46.843.4"expected "46.843.4", threw: {error, invalid}
cnpj.format#["4684348"]"46.843.48"expected "46.843.48", threw: {error, invalid}
cnpj.format#["46843485"]"46.843.485"expected "46.843.485", threw: {error, invalid}
cnpj.format#["468434850"]"46.843.485/0"expected "46.843.485/0", threw: {error, invalid}
cnpj.format#["4684348500"]"46.843.485/00"expected "46.843.485/00", threw: {error, invalid}
cnpj.format#["46843485000"]"46.843.485/000"expected "46.843.485/000", threw: {error, invalid}
cnpj.format#["468434850001"]"46.843.485/0001"expected "46.843.485/0001", threw: {error, invalid}
cnpj.format#["4684348500018"]"46.843.485/0001-8"expected "46.843.485/0001-8", threw: {error, invalid}
cnpj.format#[4]"4"expected "4", threw: error:function_clause
cnpj.format#[46]"46"expected "46", threw: error:function_clause
cnpj.format#[468]"46.8"expected "46.8", threw: error:function_clause
cnpj.format#[4684]"46.84"expected "46.84", threw: error:function_clause
cnpj.format#[46843]"46.843"expected "46.843", threw: error:function_clause
cnpj.format#[468434]"46.843.4"expected "46.843.4", threw: error:function_clause
cnpj.format#[4684348]"46.843.48"expected "46.843.48", threw: error:function_clause
cnpj.format#[46843485]"46.843.485"expected "46.843.485", threw: error:function_clause
cnpj.format#[468434850]"46.843.485/0"expected "46.843.485/0", threw: error:function_clause
cnpj.format#[4684348500]"46.843.485/00"expected "46.843.485/00", threw: error:function_clause
cnpj.format#[46843485000]"46.843.485/000"expected "46.843.485/000", threw: error:function_clause
cnpj.format#[468434850001]"46.843.485/0001"expected "46.843.485/0001", threw: error:function_clause
cnpj.format#[4684348500018]"46.843.485/0001-8"expected "46.843.485/0001-8", threw: error:function_clause
cnpj.format#[46843485000186]"46.843.485/0001-86"expected "46.843.485/0001-86", threw: error:function_clause
cnpj.format#["468434850001860000000000"]"46.843.485/0001-86"expected "46.843.485/0001-86", threw: {error, invalid}
cnpj.format#["46.?ABC843.485/0001-86abc"]"46.843.485/0001-86"expected "46.843.485/0001-86", threw: {error, invalid}
cnpj.format#[-11222333000181]""expected "", threw: error:function_clause
cnpj.format#[-1]""expected "", threw: error:function_clause
cnpj.format#[1.5]""expected "", threw: error:function_clause
cnpj.format#[9007199254740992]""expected "", threw: error:function_clause
cnpj.format#["24522200000174"]"24.522.200/0001-74"expected "24.522.200/0001-74", threw: {error, invalid}
cnpj.format#["12OUT345000199"]"12.345.000/199"expected "12.345.000/199", threw: {error, invalid}
cnpj.generate#given-branchnullexpected /^[0-9]{8}0003[0-9]{2}$/, threw: error:function_clause
cnpj.generate#[{"version":2,"branch":1}]nullexpected /^[0-9A-Z]{8}0001[0-9]{2}$/, threw: error:function_clause
cnpj.generate#[{"branch":0}]nullexpected /^[0-9]{14}$/, threw: error:function_clause
cnpj.generate#[{"branch":9999}]nullexpected /^[0-9]{8}9999[0-9]{2}$/, threw: error:function_clause
cnpj.generate#[{"branch":42}]nullexpected /^[0-9]{8}0042[0-9]{2}$/, threw: error:function_clause
cnpj.isValid#["Q0SLFMBD7VX439"]falsetrue
cnpj.isValid#["60.391.947/0001-00"]truefalse
cnpj.isValid#["11 222 333 0001 81"]truefalse
cnpj.isValid#[" 13723705000189 "]truefalse
cpf.format#[""]""expected "", threw: {error, invalid}
cpf.format#["9"]"9"expected "9", threw: {error, invalid}
cpf.format#["94"]"94"expected "94", threw: {error, invalid}
cpf.format#["943"]"943"expected "943", threw: {error, invalid}
cpf.format#["9438"]"943.8"expected "943.8", threw: {error, invalid}
cpf.format#["94389"]"943.89"expected "943.89", threw: {error, invalid}
cpf.format#["943895"]"943.895"expected "943.895", threw: {error, invalid}
cpf.format#["9438957"]"943.895.7"expected "943.895.7", threw: {error, invalid}
cpf.format#["94389575"]"943.895.75"expected "943.895.75", threw: {error, invalid}
cpf.format#["943895751"]"943.895.751"expected "943.895.751", threw: {error, invalid}
cpf.format#["9438957510"]"943.895.751-0"expected "943.895.751-0", threw: {error, invalid}
cpf.format#[9]"9"expected "9", threw: error:function_clause
cpf.format#[94]"94"expected "94", threw: error:function_clause
cpf.format#[943]"943"expected "943", threw: error:function_clause
cpf.format#[9438]"943.8"expected "943.8", threw: error:function_clause
cpf.format#[94389]"943.89"expected "943.89", threw: error:function_clause
cpf.format#[943895]"943.895"expected "943.895", threw: error:function_clause
cpf.format#[9438957]"943.895.7"expected "943.895.7", threw: error:function_clause
cpf.format#[94389575]"943.895.75"expected "943.895.75", threw: error:function_clause
cpf.format#[943895751]"943.895.751"expected "943.895.751", threw: error:function_clause
cpf.format#[9438957510]"943.895.751-0"expected "943.895.751-0", threw: error:function_clause
cpf.format#[94389575104]"943.895.751-04"expected "943.895.751-04", threw: error:function_clause
cpf.format#["94389575104000000"]"943.895.751-04"expected "943.895.751-04", threw: {error, invalid}
cpf.format#["943.?ABC895.751-04abc"]"943.895.751-04"expected "943.895.751-04", threw: {error, invalid}
cpf.format#[123456789.09]""expected "", threw: error:function_clause
cpf.format#[-1]""expected "", threw: error:function_clause
cpf.format#[1.5]""expected "", threw: error:function_clause
cpf.format#[9007199254740992]""expected "", threw: error:function_clause
cpf.isValid#["962.718.458-60"]truefalse
cpf.isValid#["123 456 789 09"]truefalse
cpf.isValid#[" 12345678909"]truefalse
cpf.isValid#["12345678909 "]truefalse
cpf.isValid#["280.012.389-38"]truefalse
licensePlate.convertToMercosul#hyphen-mask"ABC1C34"expected "ABC1C34", threw: {error, invalid}
licensePlate.convertToMercosul#already-mercosul""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#invalid""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#empty""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#["ABC12D3"]""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#["ABC1234EXTRA"]""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#["ABC12345"]""expected "", threw: {error, invalid}
licensePlate.convertToMercosul#["ABC123"]""expected "", threw: {error, invalid}
licensePlate.format#[""]""expected "", threw: {error, invalid}
licensePlate.format#["a"]"A"expected "A", threw: {error, invalid}
licensePlate.format#["ab"]"AB"expected "AB", threw: {error, invalid}
licensePlate.format#["abc"]"ABC"expected "ABC", threw: {error, invalid}
licensePlate.format#["abc1"]"ABC-1"expected "ABC-1", threw: {error, invalid}
licensePlate.format#["abc12"]"ABC-12"expected "ABC-12", threw: {error, invalid}
licensePlate.format#["abc123"]"ABC-123"expected "ABC-123", threw: {error, invalid}
licensePlate.format#["abc1d"]"ABC1D"expected "ABC1D", threw: {error, invalid}
licensePlate.format#["abc1d2"]"ABC1D2"expected "ABC1D2", threw: {error, invalid}
licensePlate.format#["abc-1234"]"ABC-1234"expected "ABC-1234", threw: {error, invalid}
licensePlate.format#["abc1-d23"]"ABC1D23"expected "ABC1D23", threw: {error, invalid}
licensePlate.format#["abc1da2"]""expected "", threw: {error, invalid}
licensePlate.format#["abc12d"]""expected "", threw: {error, invalid}
licensePlate.format#["abc12d3"]""expected "", threw: {error, invalid}
licensePlate.format#["1"]""expected "", threw: {error, invalid}
licensePlate.format#["1ab4"]""expected "", threw: {error, invalid}
licensePlate.format#["ab14"]""expected "", threw: {error, invalid}
licensePlate.generate#mercosul-fifth-char-k-to-znull"YBE0G53"
licensePlate.generate#explicit-mercosulnull"SJN6F83"
licensePlate.generate#unknown-format-falls-backnullexpected /^[A-Z]{3}[0-9][K-Z][0-9]{2}$/, threw: {error, invalid}
licensePlate.generate#bogus-format-falls-backnullthrew: {error, invalid}
licensePlate.getFormat#["WDG1S21"]"LLLNLNN""mercosul"
licensePlate.getFormat#["WDG1S22"]"LLLNLNN""mercosul"
licensePlate.getFormat#["wdg1s21"]"LLLNLNN""mercosul"
licensePlate.getFormat#["GJG8U81"]"LLLNLNN""mercosul"
licensePlate.getFormat#["GJG8U82"]"LLLNLNN""mercosul"
licensePlate.getFormat#["gjg8u81"]"LLLNLNN""mercosul"
licensePlate.getFormat#["KDS4W15"]"LLLNLNN""mercosul"
licensePlate.getFormat#["KDS4W16"]"LLLNLNN""mercosul"
licensePlate.getFormat#["kds4w15"]"LLLNLNN""mercosul"
licensePlate.getFormat#["ABC1234"]"LLLNNNN""old_format"
licensePlate.getFormat#["ABC1D23"]"LLLNLNN""mercosul"
licensePlate.isValid#["abc-1234"]truefalse
licensePlate.isValid#["ABC-1234"]truefalse
licensePlate.isValid#["ABC 1234"]truefalse
licensePlate.isValid#["ABC-1D23"]truefalse
licensePlate.isValid#["ABC1D23",{"format":"LLLNLNN"}]trueexpected true, threw: error:function_clause
licensePlate.isValid#["ABC1D23",{"format":"LLLNNNN"}]falseexpected false, threw: error:function_clause
licensePlate.isValid#["ABC1234",{"format":"LLLNNNN"}]trueexpected true, threw: error:function_clause
licensePlate.isValid#["ABC1234",{"format":"LLLNLNN"}]falseexpected false, threw: error:function_clause
licensePlate.isValid#["abc1d23",{"format":"LLLNLNN"}]trueexpected true, threw: error:function_clause
licensePlate.isValid#["ABC12D3",{"format":"LLLNLNN"}]falseexpected false, threw: error:function_clause
licensePlate.isValid#["abc",{"format":"LLLNNNN"}]falseexpected false, threw: error:function_clause
licensePlate.isValid#["ABC1D23",{"format":"mercosul"}]trueexpected true, threw: error:function_clause
licensePlate.isValid#["ABC1234",{}]trueexpected true, threw: error:function_clause
licensePlate.isValid#["ABC.1234"]truefalse
licensePlate.isValid#["ABC/1234"]truefalse
licensePlate.isValid#["ABC - 1234"]truefalse
licensePlate.isValid#["ABC-1234",{"format":"LLLNNNN"}]trueexpected true, threw: error:function_clause
passport.format#lowercase"ACD12736"expected "ACD12736", threw: {error, invalid}
passport.format#partial"AB12"expected "AB12", threw: {error, invalid}
passport.format#empty""expected "", threw: {error, invalid}
passport.format#caps-length"AB123456"expected "AB123456", threw: {error, invalid}
passport.format#["A"]"A"expected "A", threw: {error, invalid}
passport.format#["AB"]"AB"expected "AB", threw: {error, invalid}
passport.format#["AB1"]"AB1"expected "AB1", threw: {error, invalid}
passport.format#["AB123"]"AB123"expected "AB123", threw: {error, invalid}
passport.format#["AB1234"]"AB1234"expected "AB1234", threw: {error, invalid}
passport.format#["AB12345"]"AB12345"expected "AB12345", threw: {error, invalid}
passport.format#["a"]"A"expected "A", threw: {error, invalid}
passport.format#["ac"]"AC"expected "AC", threw: {error, invalid}
passport.format#["acd"]"ACD"expected "ACD", threw: {error, invalid}
passport.format#["acd1"]"ACD1"expected "ACD1", threw: {error, invalid}
passport.format#["acd12"]"ACD12"expected "ACD12", threw: {error, invalid}
passport.format#["acd127"]"ACD127"expected "ACD127", threw: {error, invalid}
passport.format#["acd1273"]"ACD1273"expected "ACD1273", threw: {error, invalid}
passport.isValid#lowercasetruefalse
passport.isValid#maskedtruefalse
passport.isValid#dottedtruefalse
passport.isValid#["AB-123.456"]truefalse
phone.format#subscriber-number"98888-7777"expected "98888-7777", threw: {error, invalid}
phone.format#partial"98888-777"expected "98888-777", threw: {error, invalid}
phone.format#empty""expected "", threw: {error, invalid}
phone.format#ddd-under-default-mask"11300-0000""(11)3000-0000"
phone.format#["9"]"9"expected "9", threw: {error, invalid}
phone.format#["98"]"98"expected "98", threw: {error, invalid}
phone.format#["988"]"988"expected "988", threw: {error, invalid}
phone.format#["9888"]"9888"expected "9888", threw: {error, invalid}
phone.format#["98888"]"98888"expected "98888", threw: {error, invalid}
phone.format#["988887"]"98888-7"expected "98888-7", threw: {error, invalid}
phone.format#["9888877"]"98888-77"expected "98888-77", threw: {error, invalid}
phone.format#[9007199254740992]""expected "", threw: error:function_clause
phone.format#["+5511988887777"]"11988-8877"expected "11988-8877", threw: {error, invalid}
phone.format#["+55 55 98888-7777"]"55988-8877"expected "55988-8877", threw: {error, invalid}
phone.format#["11900000000"]"11900-0000""(11)90000-0000"
phone.generate#["mobile"]nullexpected /^\d{2}9\d{8}$/, threw: error:function_clause
phone.generate#["landline"]nullexpected /^\d{2}[2-5]\d{7}$/, threw: error:function_clause
phone.generate#["service"]nullexpected /^(0(300|303|500|800|900)\d{7}|[34]00\d{5})$/, threw: error:function_clause
phone.isValid#["+55 0800 123 4567",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["0055 4004-1234",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["5508001234567",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["55 0300 123 4567",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["(11) 98765-4321",{"accept":[]}]falseexpected false, threw: error:function_clause
phone.isValid#["1130000000",{"accept":[]}]falseexpected false, threw: error:function_clause
phone.isValid#["08001234567",{"accept":[]}]falseexpected false, threw: error:function_clause
phone.isValid#["11612345678",{"version":2}]falseexpected false, threw: error:function_clause
phone.isValid#["11700123456",{"version":2}]falseexpected false, threw: error:function_clause
phone.isValid#["11987654321",{"accept":["landline"]}]falseexpected false, threw: error:function_clause
phone.isValid#["1130000000",{"accept":["mobile"]}]falseexpected false, threw: error:function_clause
phone.isValid#["11987654321",{"accept":["service"]}]falseexpected false, threw: error:function_clause
phone.isValid#["08001234567",{"accept":["mobile","landline"]}]falseexpected false, threw: error:function_clause
phone.isValid#["(11) 98765-4321"]truefalse
phone.isValid#["11987654321",{"version":2}]trueexpected true, threw: error:function_clause
phone.isValid#["11712345678",{"version":2}]trueexpected true, threw: error:function_clause
phone.isValid#["11812345678",{"version":2}]trueexpected true, threw: error:function_clause
phone.isValid#["(11) 3000-0000"]truefalse
phone.isValid#["11712345678",{"version":1}]trueexpected true, threw: error:function_clause
phone.isValid#["+5511987654321"]truefalse
phone.isValid#["+55 11 98765-4321"]truefalse
phone.isValid#["+55 (11) 98765-4321"]truefalse
phone.isValid#["0055 11 98765-4321"]truefalse
phone.isValid#["5511987654321"]truefalse
phone.isValid#["+55 (11) 3000-0000"]truefalse
phone.isValid#["+55 11 98765-4321",{"version":2}]trueexpected true, threw: error:function_clause
phone.isValid#["11987654321",{"accept":["mobile"]}]trueexpected true, threw: error:function_clause
phone.isValid#["1130000000",{"accept":["landline"]}]trueexpected true, threw: error:function_clause
phone.isValid#["08001234567",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["40041234",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["190",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["0800 123 4567",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["11987654321",{"accept":["mobile","landline","service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["08001234567",{"accept":["mobile","landline","service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["112",{"accept":["service"]}]trueexpected true, threw: error:function_clause
phone.isValid#["abc190",{"accept":["service"]}]falseexpected false, threw: error:function_clause
phone.isValid#["0800 123 4567 ramal 1",{"accept":["service"]}]falseexpected false, threw: error:function_clause
phone.isValid#["11.98765/4321"]truefalse
phone.isValid#["11900000000",{"accept":[]}]falseexpected false, threw: error:function_clause
pis.format#[""]""expected "", threw: {error, invalid}
pis.format#["0"]"0"expected "0", threw: {error, invalid}
pis.format#["00"]"00"expected "00", threw: {error, invalid}
pis.format#["000"]"000"expected "000", threw: {error, invalid}
pis.format#["0000"]"000.0"expected "000.0", threw: {error, invalid}
pis.format#["00000"]"000.00"expected "000.00", threw: {error, invalid}
pis.format#["000000"]"000.000"expected "000.000", threw: {error, invalid}
pis.format#["0000000"]"000.0000"expected "000.0000", threw: {error, invalid}
pis.format#["00000000"]"000.00000"expected "000.00000", threw: {error, invalid}
pis.format#["000000000"]"000.00000.0"expected "000.00000.0", threw: {error, invalid}
pis.format#["0000000000"]"000.00000.00"expected "000.00000.00", threw: {error, invalid}
pis.format#["000000000000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000.0"]"000.0"expected "000.0", threw: {error, invalid}
pis.format#["000.00"]"000.00"expected "000.00", threw: {error, invalid}
pis.format#["000.000"]"000.000"expected "000.000", threw: {error, invalid}
pis.format#["000.0000"]"000.0000"expected "000.0000", threw: {error, invalid}
pis.format#["000.00000"]"000.00000"expected "000.00000", threw: {error, invalid}
pis.format#["000.000000"]"000.00000.0"expected "000.00000.0", threw: {error, invalid}
pis.format#["000.00000.0"]"000.00000.0"expected "000.00000.0", threw: {error, invalid}
pis.format#["000.00000.00"]"000.00000.00"expected "000.00000.00", threw: {error, invalid}
pis.format#["000.00000.000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000.00000.00-0"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000.00000.00-00"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000#Error*&@#0000#Char!00000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["#-+Error#000000000000#Char!"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000000#+_Error#Char!$#000000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#[1]"1"expected "1", threw: error:function_clause
pis.format#[10]"10"expected "10", threw: error:function_clause
pis.format#[100]"100"expected "100", threw: error:function_clause
pis.format#[1000]"100.0"expected "100.0", threw: error:function_clause
pis.format#[10000]"100.00"expected "100.00", threw: error:function_clause
pis.format#[100000]"100.000"expected "100.000", threw: error:function_clause
pis.format#[1000000]"100.0000"expected "100.0000", threw: error:function_clause
pis.format#[10000000]"100.00000"expected "100.00000", threw: error:function_clause
pis.format#[100000000]"100.00000.0"expected "100.00000.0", threw: error:function_clause
pis.format#[1000000000]"100.00000.00"expected "100.00000.00", threw: error:function_clause
pis.format#[10000000000]"100.00000.00-0"expected "100.00000.00-0", threw: error:function_clause
pis.format#[100000000000]"100.00000.00-0"expected "100.00000.00-0", threw: error:function_clause
pis.format#[1000000000000]"100.00000.00-0"expected "100.00000.00-0", threw: error:function_clause
pis.format#[100.1]""expected "", threw: error:function_clause
pis.format#[100.11]""expected "", threw: error:function_clause
pis.format#[100.101]""expected "", threw: error:function_clause
pis.format#[100.1001]""expected "", threw: error:function_clause
pis.format#[100.10001]""expected "", threw: error:function_clause
pis.format#[100.100001]""expected "", threw: error:function_clause
pis.format#[100.1000001]""expected "", threw: error:function_clause
pis.format#[100.10000001]""expected "", threw: error:function_clause
pis.format#[100.100000001]""expected "", threw: error:function_clause
pis.format#["0000000000000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["00000000000000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#["000000000000000"]"000.00000.00-0"expected "000.00000.00-0", threw: {error, invalid}
pis.format#[-12345678901]""expected "", threw: error:function_clause
pis.format#[9007199254740992]""expected "", threw: error:function_clause
pis.format#["12345678901"]"123.45678.90-1"expected "123.45678.90-1", threw: {error, invalid}
pis.isValid#repeated-digitsfalsetrue
pis.isValid#["120.5641.284-7"]truefalse
pis.isValid#["120/56874/10-7"]truefalse
pis.isValid#["120 56874 10 7"]truefalse
pis.isValid#["120.1213.266-0"]truefalse
pis.isValid#["120.7041.469-0"]truefalse
renavam.isValid#["0063988/4962"]truefalse
renavam.isValid#["639884962"]truefalse
renavam.isValid#[639884962]truefalse
renavam.isValid#["0063988.4962"]truefalse
renavam.isValid#["00639884-962"]truefalse
renavam.isValid#[" 00639884962 "]truefalse
renavam.isValid#[12345678900]truefalse
voterId.format#[""]""expected "", threw: {error, invalid}
voterId.format#["1"]"1"expected "1", threw: {error, invalid}
voterId.format#["12"]"12"expected "12", threw: {error, invalid}
voterId.format#["123"]"123"expected "123", threw: {error, invalid}
voterId.format#["1234"]"1234"expected "1234", threw: {error, invalid}
voterId.format#["12345"]"1234 5"expected "1234 5", threw: {error, invalid}
voterId.format#["123456"]"1234 56"expected "1234 56", threw: {error, invalid}
voterId.format#["1234567"]"1234 567"expected "1234 567", threw: {error, invalid}
voterId.format#["12345678"]"1234 5678"expected "1234 5678", threw: {error, invalid}
voterId.format#["123456780"]"1234 5678 0"expected "1234 5678 0", threw: {error, invalid}
voterId.format#["1234567801"]"1234 5678 01"expected "1234 5678 01", threw: {error, invalid}
voterId.format#["12345678012"]"1234 5678 01 2"expected "1234 5678 01 2", threw: {error, invalid}
voterId.format#["123456780124"]"1234 5678 01 24"expected "1234 5678 01 24", threw: {error, invalid}
voterId.format#["1234567880191"]"1234 5678 80 19"expected "1234 5678 80 19", threw: {error, invalid}
voterId.format#["1234567880299"]"1234 5678 80 29"expected "1234 5678 80 29", threw: {error, invalid}
voterId.format#["12345678801912"]"1234 5678 80 19"expected "1234 5678 80 19", threw: {error, invalid}
voterId.format#["123456788019123"]"1234 5678 80 19"expected "1234 5678 80 19", threw: {error, invalid}
voterId.format#["12345678803991"]"1234 5678 80 39"expected "1234 5678 80 39", threw: {error, invalid}
voterId.format#["1234567880399"]"1234 5678 80 39"expected "1234 5678 80 39", threw: {error, invalid}
voterId.format#["123456788"]"1234 5678 8"expected "1234 5678 8", threw: {error, invalid}
voterId.format#["123456788019"]"1234 5678 80 19"expected "1234 5678 80 19", threw: {error, invalid}
voterId.format#["123450159"]"1234 5015 9"expected "1234 5015 9", threw: {error, invalid}
voterId.format#[-123456780124]""expected "", threw: error:function_clause
voterId.format#[1.5]""expected "", threw: error:function_clause
voterId.format#[9007199254740992]""expected "", threw: error:function_clause
voterId.format#["123456780175"]"1234 5678 01 75"expected "1234 5678 01 75", threw: {error, invalid}
voterId.isValid#["1234567880191"]falsetrue
voterId.isValid#["1023-8501-06-71"]truefalse
voterId.isValid#["1023 8501 06 71"]truefalse
voterId.isValid#["1023.8501.06.71"]truefalse
voterId.isValid#["000010191"]truefalse
voterId.isValid#["123450159"]truefalse
voterId.isValid#["00123450159"]truefalse
voterId.isValid#["1 2345 01 59"]truefalse
voterId.isValid#["12345 01 59"]truefalse
voterId.isValid#["122844"]truefalse
voterId.isValid#["12340639"]truefalse
voterId.isValid#["1234 06 39"]truefalse
voterId.isValid#["10191"]truefalse
voterId.isValid#["0123456780191"]falsetrue
voterId.isValid#["0001.2345.01.59"]truefalse
voterId.isValid#["123 4567 01 91"]truefalse
voterId.isValid#["1023-8501/06-71"]truefalse
voterId.isValid#[" 1023 8501 06 71 "]truefalse

Functions without a usage example

These functions work, but the library's usage files have no example for them. Their tab on this site is empty.

Badge for your README

The badge shows the share of core functions and the cases that pass, and changes with every run. Paste this Markdown in the library's README:

API contract: 12.5% of core functions, 340 shared cases pass

[![API contract](https://brazilian-utils.com.br/badges/erlang.svg)](https://brazilian-utils.com.br/libs/erlang/)

On this page