tangled
alpha
login
or
join now
cuducos.me
/
go-cnpf
0
fork
atom
🇧🇷 CPF and CNPJ validation in Go
0
fork
atom
overview
issues
pulls
pipelines
Fixes indentation in README.md
Eduardo Cuducos
6 years ago
a3b3df82
4830f8a5
+6
-7
1 changed file
expand all
collapse all
unified
split
README.md
+6
-7
README.md
···
1
1
-
# Go CNPF []()[](https://godoc.org/github.com/cuducos/go-cnpf)
1
1
+
# Go CNPF []() [](https://godoc.org/github.com/cuducos/go-cnpf) 
2
2
3
3
A Go module to validate CPF and CNPJ numbers (Brazilian people andcompanies unique identifier for the Federal Revenue).
4
4
···
14
14
// these return true
15
15
cnpf.IsValid("23858488135")
16
16
cnpf.IsValid("238.584.881-35")
17
17
-
cnpf.IsValid("11222333000181")
17
17
+
cnpf.IsValid("11222333000181")
18
18
cnpf.IsValid("11.222.333/0001-81")
19
19
20
20
// these return false
···
22
22
cnpf.IsValid("11.111.111/1111-11")
23
23
cnpf.IsValid("123.456.769/01")
24
24
cnpf.IsValid("12.345.678 9012-34")
25
25
-
cnpf.IsValid("ABC.DEF.GHI-JK")
26
26
-
cnpf.IsValid("AB.CDE.FGH/IJKL-MN")
25
25
+
cnpf.IsValid("ABC.DEF.GHI-JK")
26
26
+
cnpf.IsValid("AB.CDE.FGH/IJKL-MN")
27
27
cnpf.IsValid("123")
28
28
29
29
// these returns 11111111111 and 11111111111111
30
30
-
cnpf.Unmask("111.111.111-11")
30
30
+
cnpf.Unmask("111.111.111-11")
31
31
cnpf.Unmask("11.111.111/1111-11")
32
32
33
33
// this returns 111.111.111-11 and 11.111.111/1111-11
34
34
-
cnpf.Mask("11111111111")
34
34
+
cnpf.Mask("11111111111")
35
35
cnpf.Mask("11111111111111")
36
36
-
37
36
}
38
37
```
39
38