vinibrsl / burocracia.cr

👔 Zero-dependency Crystal shard to validate, generate and format Brazilian burocracias (CPF, CNPJ, CEP)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module to cover Brazilian phone numbers

vinibrsl opened this issue · comments

Brazilians phone numbers can be hard to generate, validate and format, seen that there are at least three types of phone numbers in Brazil:

  • Landline phones, eg.: +55 XX 3XXX-XXXX
  • Mobile phones, eg.: +55 XX 9XXXX-XXXX or +55 XX 9XXX-XXXX
  • Non-geographic phones, eg.: 0X00 XXX XXXX

It would be great to provide methods to:

  • Validate phone numbers by type
  • Generate phone numbers by type
  • Recognize phone number types
  • Format phone numbers