{"id":17864080,"url":"https://github.com/cuducos/go-cnpf","last_synced_at":"2025-07-26T19:11:01.381Z","repository":{"id":76812815,"uuid":"251464152","full_name":"cuducos/go-cnpf","owner":"cuducos","description":"🇧🇷 CPF and CNPJ validation in Go","archived":false,"fork":false,"pushed_at":"2024-10-28T20:46:06.000Z","size":8,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T16:21:37.791Z","etag":null,"topics":["brasil","brazil","cnpj","cpf","go","hacktoberfest","validation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuducos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["cuducos"]}},"created_at":"2020-03-31T00:53:09.000Z","updated_at":"2024-10-28T20:45:50.000Z","dependencies_parsed_at":"2023-03-06T13:30:26.798Z","dependency_job_id":null,"html_url":"https://github.com/cuducos/go-cnpf","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"cbfd378acf27e6be6532e8ce6a10fd46334acbaf"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cuducos/go-cnpf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgo-cnpf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgo-cnpf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgo-cnpf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgo-cnpf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuducos","download_url":"https://codeload.github.com/cuducos/go-cnpf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuducos%2Fgo-cnpf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267213582,"owners_count":24053912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brasil","brazil","cnpj","cpf","go","hacktoberfest","validation"],"created_at":"2024-10-28T09:08:43.186Z","updated_at":"2025-07-26T19:11:01.345Z","avatar_url":"https://github.com/cuducos.png","language":"Go","funding_links":["https://github.com/sponsors/cuducos"],"categories":[],"sub_categories":[],"readme":"# Go CNPF [![Tests](https://github.com/cuducos/go-cnpf/workflows/Tests/badge.svg)]() [![GoDoc](https://godoc.org/github.com/cuducos/go-cnpf?status.svg)](https://godoc.org/github.com/cuducos/go-cnpf) ![Go version](https://img.shields.io/github/go-mod/go-version/cuducos/go-cnpj)\n\nA Go module to validate CPF and CNPJ numbers (Brazilian people and companies unique identifier for the Federal Revenue).\n\n\u003e The pseudo-acronym _CNPF_ is a sort of tong-twister and a common typo when developers discuss the implementation of objects that could hold either a CPF or a CNPJ numbers.\n\n```go\npackage main\n\nimport \"github.com/cuducos/go-cnpf\"\n\n\nfunc main() {\n\t// these return true\n\tcnpf.IsValid(\"23858488135\")\n\tcnpf.IsValid(\"238.584.881-35\")\n\tcnpf.IsValid(\"11222333000181\")\n\tcnpf.IsValid(\"11.222.333/0001-81\")\n\tcnpj.IsValid(\"12.ABC.345/01DE-35\")\n\tcnpj.IsValid(\"12ABC34501DE35\")\n\n\t// these return false\n\tcnpf.IsValid(\"111.111.111-11\")\n\tcnpf.IsValid(\"11.111.111/1111-11\")\n\tcnpf.IsValid(\"123.456.769/01\")\n\tcnpf.IsValid(\"12.345.678 9012-34\")\n\tcnpf.IsValid(\"ABC.DEF.GHI-JK\")\n\tcnpf.IsValid(\"AB.CDE.FGH/IJKL-MN\")\n\tcnpf.IsValid(\"123\")\n\n\t// these return 11111111111, 11111111111111 and 12ABC34501DE35\n\tcnpf.Unmask(\"111.111.111-11\")\n\tcnpf.Unmask(\"11.111.111/1111-11\")\n\tcnpj.Unmask(\"12.ABC.345/01DE-35\")\n\n\t// this return 111.111.111-11, 11.111.111/1111-11 and 12.ABC.345/01DE-35\n\tcnpf.Mask(\"11111111111\")\n\tcnpf.Mask(\"11111111111111\")\t\n\tcnpj.Mask(\"12ABC34501DE35\")\n}\n```\n\u003e [!IMPORTANT]\n\u003e Starting in July 2026 [the CNPJ number will be alphanumeric](https://www.gov.br/receitafederal/pt-br/acesso-a-informacao/acoes-e-programas/programas-e-atividades/cnpj-alfanumerico). This package **already supports the new format**. If you **do not** want to support the new format, tag this package to [`v0.0.1`](https://github.com/cuducos/go-cnpf/releases/tag/v0.0.1).\n\nBased on [Go CPF](https://github.com/cuducos/go-cpf) and [Go CNPJ](https://github.com/cuducos/go-cnpj) ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuducos%2Fgo-cnpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuducos%2Fgo-cnpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuducos%2Fgo-cnpf/lists"}