diff --git a/README.md b/README.md index e69de29..83e2acf 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,160 @@ +# ValidGen + + + + + +**Valigen** is a Go library for generating and validating various types of structured data, such as Brazilian CPF, CNPJ, and other formatted identifiers. It provides an efficient and easy-to-use API to handle data validation, formatting, and generation. + +If you need a reliable solution for working with structured data, **Valigen** is the perfect choice. + +## Key Features + +- **Data Generation** – Generate valid CPF, CNPJ, and other structured identifiers. +- **Validation** – Easily check if a given value is correctly formatted and valid. +- **Formatting & Unformatting** – Convert data between formatted and raw versions. +- **Flexible & Extensible** – Supports multiple data types and validation rules. +- **User-Friendly API** – Simple and intuitive integration with any Go project. +- **High Performance** – Optimized for speed and efficiency. + +For more details and usage examples, check out the **Valigen** repository. + +## **Installation** + +To install the ValidGen package, use the following command: + +```sh +go get github.com/Hublastt/ValidGen +``` + +## Usage + +Below are examples of how to use the various functions provided by the ValidGen package. + +
+Validate CPF + +To validate a CPF number: + +```go +package main + +import ( + "fmt" + "github.com/Hublastt/ValidGen/validgen" +) + +func main() { + err := validgen.ValidateCPF("12345678909") + if err != nil { + fmt.Println("Invalid CPF:", err) + } else { + fmt.Println("CPF is valid") + } +} +``` +
+ +
+Generate CPF + +To generate a valid CPF number: + +```go +package main + +import ( + "fmt" + "github.com/Hublastt/ValidGen/validgen" +) + +func main() { + cpf, err := validgen.GenerateCPF() + if err != nil { + fmt.Println("Error generating CPF:", err) + } else { + fmt.Println("Generated CPF:", cpf) + } +} +``` +
+ +
+Format CPF + +To format a CPF number: + +```go +package main + +import ( + "fmt" + "github.com/Hublastt/ValidGen/validgen" +) + +func main() { + formattedCPF, err := validgen.FormatCPF("12345678909") + if err != nil { + fmt.Println("Error formatting CPF:", err) + } else { + fmt.Println("Formatted CPF:", formattedCPF) + } +} +``` +
+ +
+Unformat CPF + +To unformat a CPF number: + +```go +package main + +import ( + "fmt" + "github.com/Hublastt/ValidGen/validgen" +) + +func main() { + unformattedCPF, err := validgen.UnformatCPF("123.456.789-09") + if err != nil { + fmt.Println("Error unformatting CPF:", err) + } else { + fmt.Println("Unformatted CPF:", unformattedCPF) + } +} +``` +
+ +
+Format Generated CPF + +To format a generated CPF number: + +```go +package main + +import ( + "fmt" + "github.com/Hublastt/ValidGen/validgen" +) + +func main() { + formattedGeneratedCPF, err := validgen.FormatGeneratedCPF() + if err != nil { + fmt.Println("Error formatting generated CPF:", err) + } else { + fmt.Println("Formatted Generated CPF:", formattedGeneratedCPF) + } +} +``` +
+ +## Contributing + +Contributions are welcome! If you would like to contribute, feel free to open a pull request. + +## License + +This project is licensed under the MIT License. diff --git a/static/assets/go_logo.png b/static/assets/go_logo.png new file mode 100644 index 0000000..961fa97 Binary files /dev/null and b/static/assets/go_logo.png differ