{"id":41179696,"url":"https://github.com/jkomyno/nanoid","last_synced_at":"2026-01-22T20:03:58.557Z","repository":{"id":38713696,"uuid":"103403594","full_name":"jkomyno/nanoid","owner":"jkomyno","description":"Golang port of ai/nanoid (originally written in JavaScript)","archived":false,"fork":false,"pushed_at":"2021-04-15T08:52:52.000Z","size":10,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T06:56:21.833Z","etag":null,"topics":["cryptography","nanoid","port","random","random-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/jkomyno.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}},"created_at":"2017-09-13T13:30:45.000Z","updated_at":"2024-06-19T06:56:21.834Z","dependencies_parsed_at":"2022-08-29T20:01:24.562Z","dependency_job_id":null,"html_url":"https://github.com/jkomyno/nanoid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkomyno/nanoid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkomyno%2Fnanoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkomyno%2Fnanoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkomyno%2Fnanoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkomyno%2Fnanoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkomyno","download_url":"https://codeload.github.com/jkomyno/nanoid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkomyno%2Fnanoid/sbom","scorecard":{"id":522572,"data":{"date":"2025-08-11","repo":{"name":"github.com/jkomyno/nanoid","commit":"937cefe9123ed38ac8c80313085bdd37841e7301"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T03:26:21.555Z","repository_id":38713696,"created_at":"2025-08-20T03:26:21.555Z","updated_at":"2025-08-20T03:26:21.555Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28670366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cryptography","nanoid","port","random","random-generator","security"],"created_at":"2026-01-22T20:03:58.494Z","updated_at":"2026-01-22T20:03:58.550Z","avatar_url":"https://github.com/jkomyno.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanoid\nGolang port of [ai/nanoid](https://github.com/ai/nanoid) (originally written in JavaScript).\n\n[![Build Status](https://travis-ci.org/jkomyno/nanoid.svg?branch=master)](https://travis-ci.org/jkomyno/nanoid) [![GoDoc](https://godoc.org/github.com/jkomyno/nanoid?status.svg)](https://godoc.org/github.com/jkomyno/nanoid) [![Go Report Card](https://goreportcard.com/badge/github.com/jkomyno/nanoid)](https://goreportcard.com/report/github.com/jkomyno/nanoid)\n\n# Description\nA tiny, secure URL-friendly unique string ID generator for Golang.\n\n**Safe.** It uses cryptographically strong random APIs\nand guarantees a proper distribution of symbols.\n\n**Compact.** It uses more symbols than UUID (`A-Za-z0-9_~`)\nand has the same number of unique options in just 22 symbols instead of 36.\n\n**No third party dependencies** No need to pollute your $GOPATH\n\n## Install\n\n```bash\n$ go get github.com/jkomyno/nanoid\n```\n\n## Testing\n\n``` bash\n$ go test -v -bench=.\n```\n\nYou should be able to see a log similar to the following one:\n```\n=== RUN   TestGeneratesURLFriendlyIDs\n--- PASS: TestGeneratesURLFriendlyIDs (0.00s)\n=== RUN   TestHasNoCollisions\n--- PASS: TestHasNoCollisions (0.21s)\n=== RUN   TestFlatDistribution\n--- PASS: TestFlatDistribution (0.33s)\ngoos: linux\ngoarch: amd64\npkg: github.com/jkomyno/nanoid\nBenchmarkNanoid-4        1000000              1704 ns/op\nPASS\nok      github.com/jkomyno/nanoid       2.265s\n```\n\n## Usage\n**This packages tries to offer an API as close as possible to the original JS module.**\n\n### Normal\n\nThe Nanoid() function uses URL-friendly symbols (`A-Za-z0-9_~`) and returns an ID\nwith 22 characters (to have the same collisions probability as UUID v4).\nPlease note that it also returns an error, which (hopefully) will be `nil`.\n\n```go\nimport \"github.com/jkomyno/nanoid\"\n\nid, err := nanoid.Nanoid() //=\u003e \"Uakgb_J5m9g~0JDMbcJqLJ\"\n```\n\nSymbols `-,.()` are not encoded in URL, but in the end of a link\nthey could be identified as a punctuation symbol.\n\nIf you want to reduce ID length (and increase collisions probability),\nyou can pass length as argument:\n\n```go\nimport \"github.com/jkomyno/nanoid\"\n\nid, err := nanoid.Nanoid(10) //=\u003e \"IRFa~VaY2b\"\n```\n\n### Custom Alphabet or Length\n\nIf you want to change the ID alphabet or the length\nyou can use low-level `Generate` function.\n\n```go\nimport \"github.com/jkomyno/nanoid\"\n\nid, err := nanoid.Generate(\"1234567890abcdef\", 10) //=\u003e \"4f90d13a42\"\n```\n\nAlphabet must contain less than 256 symbols.\n\n### Custom Random Bytes Generator\n\nYou can replace the default safe random generator using the `Format` function.\n\n```go\nimport (\n    \"crypto/rand\"\n\n    \"github.com/jkomyno/nanoid\"\n)\n\nfunc random(size int) ([]byte, error) {\n\tvar randomBytes = make([]byte, size)\n\t_, err := rand.Read(randomBytes)\n\treturn randomBytes, err\n}\n\nid, err := nanoid.Format(random, \"abcdef\", 10) //=\u003e \"fbaefaadeb\"\n```\n\nNote that `random` function must follow this spec:\n```go\ntype RandomType func(int) ([]byte, error)\n```\n\nIf you want to use the same URL-friendly symbols with `format`,\nor take a look at the other defaults value, you can use `GetDefaults`.\n\n```go\nimport \"github.com/jkomyno/nanoid\"\n\nvar defaults *nanoid.DefaultsType\ndefaults = nanoid.GetDefaults()\n/*\n\t\u0026DefaultsType{\n\t\tAlphabet: \"_~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n\t\tSize:     22,\n\t\tMaskSize: 5,\n\t}\n*/\n```\n\n## Credits\n\n[ai](https://github.com/ai) - [nanoid](https://github.com/ai/nanoid)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkomyno%2Fnanoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkomyno%2Fnanoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkomyno%2Fnanoid/lists"}