{"id":13413776,"url":"https://github.com/m1/go-generate-password","last_synced_at":"2025-07-04T19:38:36.025Z","repository":{"id":42028204,"uuid":"221756816","full_name":"m1/go-generate-password","owner":"m1","description":"Password generator written in Golang, usable as a CLI or Go library. Provides options for human readable and accessibility friendly passwords. ","archived":false,"fork":false,"pushed_at":"2022-04-17T11:17:05.000Z","size":18,"stargazers_count":55,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T22:38:17.258Z","etag":null,"topics":["go","go-library","golang","golang-library","hacktoberfest","password","password-generating","password-generator","security"],"latest_commit_sha":null,"homepage":"","language":"Go","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/m1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-14T17:57:19.000Z","updated_at":"2025-03-23T01:04:04.000Z","dependencies_parsed_at":"2022-08-12T02:50:21.287Z","dependency_job_id":null,"html_url":"https://github.com/m1/go-generate-password","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/m1/go-generate-password","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1%2Fgo-generate-password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1%2Fgo-generate-password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1%2Fgo-generate-password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1%2Fgo-generate-password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m1","download_url":"https://codeload.github.com/m1/go-generate-password/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m1%2Fgo-generate-password/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263608818,"owners_count":23488069,"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":["go","go-library","golang","golang-library","hacktoberfest","password","password-generating","password-generator","security"],"created_at":"2024-07-30T20:01:49.049Z","updated_at":"2025-07-04T19:38:35.962Z","avatar_url":"https://github.com/m1.png","language":"Go","funding_links":[],"categories":["Security","安全","安全领域相关库","Relational Databases"],"sub_categories":["HTTP Clients","HTTP客户端","查询语"],"readme":"# go-generate-password\n\n[![GoDoc](https://godoc.org/github.com/m1/go-generate-password?status.svg)](https://godoc.org/github.com/m1/go-generate-password)\n[![Build Status](https://travis-ci.org/m1/go-generate-password.svg?branch=master)](https://travis-ci.org/m1/go-generate-password)\n[![Go Report Card](https://goreportcard.com/badge/github.com/m1/go-generate-password)](https://goreportcard.com/report/github.com/m1/go-generate-password)\n[![Release](https://img.shields.io/github/release/m1/go-generate-password.svg)](https://github.com/m1/go-generate-password/releases/latest)\n[![codecov](https://codecov.io/gh/m1/go-generate-password/branch/master/graph/badge.svg)](https://codecov.io/gh/m1/go-generate-password)\n\n__Password generator written in Go.  Use as a [library](#library) or as a [CLI](#cli).__\n\n## Usage\n\n### CLI\n\ngo-generate-password can be used on the cli, just install using: `go get github.com/m1/go-generate-password/cmd/go-generate-password`\n\nTo use:\n```\n➜  go-generate-password --help\ngo-generate-password is a password generating engine written in Go.\n\nUsage:\n  go-generate-password [flags]\n\nFlags:\n      --characters string   Character set for the config\n      --exclude-ambiguous   Exclude ambiguous characters (default true)\n      --exclude-similar     Exclude similar characters (default true)\n  -h, --help                help for go-generate-password\n  -l, --length int          Length of the password (default 24)\n      --lowercase           Include lowercase letters (default true)\n      --numbers             Include numbers (default true)\n      --symbols             Include symbols (default true)\n  -n, --times int           How many passwords to generate (default 1)\n      --uppercase           Include uppercase letters (default true)\n```\n\nFor example: \n```\n➜  go-generate-password\n5PU?rG-w9YkDus4?AbmKd+Z*\n```\n\nMore detailed example:\n```\n➜  go-generate-password -n 5 --length 16 --symbols=false\nX89R4HvATgg7HSKk\nYMwMPnXp7cnMTNdZ\nRZWKAvyxFxDWRB8u\nPvKb6uP4N7vAMVsD\nKHttvhevGrTYptM5\n```\n\nExample using custom character set:\n```.env\n➜  go-generate-password -n 5 --characters=abcdefg01       \n10cecfcfe0bea1fdcbb1afcf\nbfcgbgg0dccafdacdaa1de01\ngb0ggcffcefae0bb1ac0bbge\nabafbc1bbaff0cfbdgaee11d\n1fge0fcbccabda0g0a01ffc0\n```\n\n### Library\nTo use as a library is pretty simple:\n\n```go\nconfig := generator.Config{\n\t\tLength:                     16,\n\t\tIncludeSymbols:             false,\n\t\tIncludeNumbers:             true,\n\t\tIncludeLowercaseLetters:    true,\n\t\tIncludeUppercaseLetters:    true,\n\t\tExcludeSimilarCharacters:   true,\n\t\tExcludeAmbiguousCharacters: true,\n\t}\ng, _ := generator.New(\u0026config)\n\npwd, _ := g.Generate() \n// pwd = 8hp43B2R7gaXrZUW\n\npwds, _ := g.GenerateMany(5)\n// pwds = [\n//   dnPp2TW2e8wmkAwT,\n//   XVYwWn25xuNwhUTy,\n//   vQ8aSrustQzxQCkA,\n//   AuT4fu5RU9TtxEUR,\n//   muDwwBRpKpC5BcHr,\n// ]\n\npwd, _ = g.GenerateWithLength(12)\n// pwd = HHhpzRGsmEWt\n\npwds, _ := g.GenerateManyWithLength(5, 12)\n// pwds = [\n//   s5TKYPdgRzvZ\n//   wZFgzs8PUvRg\n//   tU73qZ9sPzEs\n//   mMaYU6hkvxPQ\n//   KBNZ2D7cVQS2\n// ]\n```\n\nThe library also comes with some helper constants:\n```go\nconst (\n\t// LengthWeak weak length password\n\tLengthWeak = 6\n\n\t// LengthOK ok length password\n\tLengthOK = 12\n\n\t// LengthStrong strong length password\n\tLengthStrong = 24\n\n\t// LengthVeryStrong very strong length password\n\tLengthVeryStrong = 36\n\n\t// DefaultLetterSet is the letter set that is defaulted to - just the\n\t// alphabet\n\tDefaultLetterSet = \"abcdefghijklmnopqrstuvwxyz\"\n\n\t// DefaultLetterAmbiguousSet are letters which are removed from the\n\t// chosen character set if removing similar characters\n\tDefaultLetterAmbiguousSet = \"ijlo\"\n\n\t// DefaultNumberSet the default symbol set if character set hasn't been\n\t// selected\n\tDefaultNumberSet = \"0123456789\"\n\n\t// DefaultNumberAmbiguousSet are the numbers which are removed from the\n\t// chosen character set if removing similar characters\n\tDefaultNumberAmbiguousSet = \"01\"\n\n\t// DefaultSymbolSet the default symbol set if character set hasn't been\n\t// selected\n\tDefaultSymbolSet = \"!$%^\u0026*()_+{}:@[];'#\u003c\u003e?,./|\\\\-=?\"\n\n\t// DefaultSymbolAmbiguousSet are the symbols which are removed from the\n\t// chosen character set if removing ambiguous characters\n\tDefaultSymbolAmbiguousSet = \"\u003c\u003e[](){}:;'/|\\\\,\"\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1%2Fgo-generate-password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm1%2Fgo-generate-password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm1%2Fgo-generate-password/lists"}