{"id":19029106,"url":"https://github.com/sulmar/polish-validators","last_synced_at":"2025-09-06T23:31:05.948Z","repository":{"id":46209923,"uuid":"260173472","full_name":"sulmar/polish-validators","owner":"sulmar","description":"Library for validation of Polish NIP, PESEL, REGON","archived":false,"fork":false,"pushed_at":"2023-09-13T09:52:10.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-08T21:13:22.519Z","etag":null,"topics":["csharp","nip-validation","pesel-validation","polish"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sulmar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-30T09:50:27.000Z","updated_at":"2024-01-08T10:39:13.000Z","dependencies_parsed_at":"2024-11-08T21:13:23.055Z","dependency_job_id":"d1478eff-78b6-45c7-958f-8279473517c5","html_url":"https://github.com/sulmar/polish-validators","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulmar%2Fpolish-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulmar%2Fpolish-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulmar%2Fpolish-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulmar%2Fpolish-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sulmar","download_url":"https://codeload.github.com/sulmar/polish-validators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232149090,"owners_count":18479430,"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","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":["csharp","nip-validation","pesel-validation","polish"],"created_at":"2024-11-08T21:13:17.631Z","updated_at":"2025-01-02T03:32:12.701Z","avatar_url":"https://github.com/sulmar.png","language":"C#","readme":"# Polish Validators for C#\nLibrary for validation of Polish NIP, PESEL, REGON for C# (.NET Standard)\n\n\n## Description\nMost validation algorithms are published separate. They differ only in weights and checksum function.\nThat's why I decided to write a simple implementation for C# using **Template Method** design pattern.\n\n## Get Started\nPolishValidators can be installed using the Nuget package manager or the dotnet CLI.\n\n~~~ \nInstall-Package PolishValidators\n~~~\n\n~~~ \ndotnet add package PolishValidators\n~~~\n\n## Usage\n\n~~~ csharp\nIValidator validator = new PeselValidator();\nbool result = validator.IsValid(\"49040501580\");\n~~~\n\n~~~ csharp\nIValidator validator = new NipValidator();\nbool result = validator.IsValid(\"9531204591\");\n~~~\n\n## Custom Validator\n\nYou can easily create a new validator. \nJust use abstract class _ValidatorBase_ and override _Weights_ and sum control function like this:\n\n~~~ csharp\npublic class CustomValidator : ValidatorBase\n{\n    protected override byte[] Weights =\u003e new byte[] { 1, 5, 7, 9, 1, 5, 7, 9, 5, 3 };\n    protected override int CheckControl(int sumControl) =\u003e 10 - sumControl % 10;\n}\n~~~\n\nGood luck :)\n\n\n## Route constraints \n\nIf you are looking for route constraints for MVC or Razor Pages projects then I invite you my another project using PolishValidators library:\nhttps://github.com/sulmar/Sulmar.AspNetCore.Routing.RouteConstraints\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulmar%2Fpolish-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsulmar%2Fpolish-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulmar%2Fpolish-validators/lists"}