{"id":15845017,"url":"https://github.com/leonklingele/randomstring","last_synced_at":"2025-07-16T12:33:02.450Z","repository":{"id":57491112,"uuid":"80677721","full_name":"leonklingele/randomstring","owner":"leonklingele","description":"Cryptographically secure random strings in Go","archived":false,"fork":false,"pushed_at":"2025-05-10T22:22:26.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-10T23:20:09.923Z","etag":null,"topics":["crypto","password","random","random-string","secure"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonklingele.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}},"created_at":"2017-02-02T00:06:22.000Z","updated_at":"2025-05-10T22:22:26.000Z","dependencies_parsed_at":"2024-03-10T14:50:56.621Z","dependency_job_id":"06c1e727-23b1-49d2-8ac8-cb035700863c","html_url":"https://github.com/leonklingele/randomstring","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/leonklingele/randomstring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonklingele%2Frandomstring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonklingele%2Frandomstring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonklingele%2Frandomstring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonklingele%2Frandomstring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonklingele","download_url":"https://codeload.github.com/leonklingele/randomstring/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonklingele%2Frandomstring/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265509405,"owners_count":23779351,"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":["crypto","password","random","random-string","secure"],"created_at":"2024-10-05T17:41:37.300Z","updated_at":"2025-07-16T12:33:02.422Z","avatar_url":"https://github.com/leonklingele.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptographically secure random strings in Go\n\n![test](https://github.com/leonklingele/randomstring/actions/workflows/test.yml/badge.svg)\n\nI was tired of so many Go apps and libraries being [modulo-biased](https://stackoverflow.com/a/10984975) when generating random strings.\nHere's another library to generate cryptographically secure and unbiased strings.\nInternally this library uses Go's [crypto/rand](https://golang.org/pkg/crypto/rand/) package which reads from the best random generator your system provides.\n\n## tl;dr\n\n```sh\n# Install library\ngo get -u github.com/leonklingele/randomstring/v2\n```\n\n```go\n// .. and use it. Generate a 30 character long string\ns, err := randomstring.Generate(30, randomstring.CharsASCII)\n```\n\n```go\n// You can even use your own alphabet \"abc\". Be careful though!\ns, err := randomstring.Generate(30, \"abc\")\n```\n\nSupported alphabets:\n\n- `randomstring.CharsNum`: Contains numbers from 0-9\n- `randomstring.CharsAlpha`: Contains the full English alphabet: letters a-z and A-Z\n- `randomstring.CharsAlphaNum`: Is a combination of CharsNum and CharsAlpha\n- `randomstring.CharsASCII`: Contains all printable ASCII characters in code range [32, 126]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonklingele%2Frandomstring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonklingele%2Frandomstring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonklingele%2Frandomstring/lists"}