{"id":29207683,"url":"https://github.com/kpol/passwordgenerator","last_synced_at":"2025-07-30T19:34:16.988Z","repository":{"id":301984772,"uuid":"1009942913","full_name":"kpol/PasswordGenerator","owner":"kpol","description":"A lightweight, secure, and flexible password generator library for .NET, built with cryptographic randomness and fully customizable character sets.","archived":false,"fork":false,"pushed_at":"2025-07-07T02:20:00.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T03:32:34.211Z","etag":null,"topics":["csharp","password","password-generator","security"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kpol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-06-28T02:38:07.000Z","updated_at":"2025-07-07T02:20:02.000Z","dependencies_parsed_at":"2025-07-07T03:24:58.387Z","dependency_job_id":null,"html_url":"https://github.com/kpol/PasswordGenerator","commit_stats":null,"previous_names":["kpol/passwordgenerator"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kpol/PasswordGenerator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpol%2FPasswordGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpol%2FPasswordGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpol%2FPasswordGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpol%2FPasswordGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kpol","download_url":"https://codeload.github.com/kpol/PasswordGenerator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kpol%2FPasswordGenerator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267929063,"owners_count":24167433,"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-30T02:00:09.044Z","response_time":70,"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":["csharp","password","password-generator","security"],"created_at":"2025-07-02T19:07:27.047Z","updated_at":"2025-07-30T19:34:16.976Z","avatar_url":"https://github.com/kpol.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PasswordGenerator\n\nA lightweight, secure, and flexible password generator library for .NET, built with cryptographic randomness and fully customizable character sets.\n\n[![Build \u0026 Test](https://github.com/kpol/PasswordGenerator/actions/workflows/build-test.yml/badge.svg)](https://github.com/kpol/PasswordGenerator/actions)\n[![NuGet](https://img.shields.io/nuget/v/KPasswordGenerator.svg)](https://www.nuget.org/packages/KPasswordGenerator)\n\n---\n\n## Features\n\n- **Cryptographically secure** — built on .NET’s [`RandomNumberGenerator`](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.randomnumbergenerator) for high-entropy randomness\n- **Performance-focused** — uses `Span\u003cchar\u003e` and stack allocation to minimize heap usage and avoid unnecessary string allocations\n- **Customizable character sets** — define your own character pools (e.g., symbols, digits, uppercase)\n- **Per-set minimum requirements** — ensure that a minimum number of characters from each set are included\n- **Predictable-free output** — final password is securely shuffled to eliminate character order patterns\n- **Ambiguity-avoiding** — easily exclude confusing characters like `0`, `O`, `l`, and `I`\n- Clean, testable design — .NET 8 compatible and unit-tested\n\n\n---\n\n```csharp\nusing KPasswordGenerator;\n\n// Define your password policy\nPasswordSettings settings = new(\n[\n    new(minRequired: 2, characterPool: \"ABCDEFGHJKLMNPQRSTUVWXYZ\"),\n    new(3, \"abcdefghijkmnopqrstuvwxyz\"),   // At least 3 lowercase letters (no l)\n    new(4, \"23456789\"),                    // At least 4 digits (no 0, 1)\n    new(2, \"!@$?_-\")                       // At least 2 symbols\n]);\n\nPasswordGenerator generator = new(settings);\n\nstring password = generator.Generate(passwordLength: 16);\n\nConsole.WriteLine(password);  // Example output: kAj79uV@E?m7_8eS\n```\n\n### Using WithDefaults\nQuickly generate a password using default pools:\n```csharp\nPasswordSettings settings = PasswordSettings.WithDefaults(minLower: 2, minUpper: 2, minDigits: 2, minSpecial: 1);\nPasswordGenerator generator = new(settings);\n\nstring password = generator.Generate(12);\n```\n\n## Additional Methods\n\n### `GenerateRandomLength(int minPasswordLength, int maxPasswordLength)`\n\nGenerates a password of **random length within a specified range**.\n\n- Ensures the generated password meets all defined character requirements.\n- Uses secure randomness to choose the length.\n\n**Example:**\n```csharp\nstring password = generator.GenerateRandomLength(12, 20);\n```\n\n---\n\n### `Validate(string password)`\n\nValidates whether a password meets the current `PasswordSettings` policy.\n\n- Checks overall length.\n- Verifies that the required number of characters from each character pool are present.\n- Returns `true` if all rules pass, otherwise `false`.\n\n- **Example:**\n```csharp\nbool isValid = generator.Validate(\"abcD123!\");\n```\n\n## Installation\n\nInstall via NuGet:\n\n```bash\ndotnet add package KPasswordGenerator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpol%2Fpasswordgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkpol%2Fpasswordgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkpol%2Fpasswordgenerator/lists"}