{"id":19621362,"url":"https://github.com/commenthol/secure-identifier","last_synced_at":"2026-05-11T12:34:11.346Z","repository":{"id":57371749,"uuid":"121857270","full_name":"commenthol/secure-identifier","owner":"commenthol","description":"secure identifier for usernames","archived":false,"fork":false,"pushed_at":"2021-01-15T14:59:20.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T19:11:54.510Z","etag":null,"topics":["identifier","mechanism","rfc-2142","secure","security","tr39","unicode","username"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-17T13:25:40.000Z","updated_at":"2021-07-26T09:00:20.000Z","dependencies_parsed_at":"2022-09-18T22:32:14.400Z","dependency_job_id":null,"html_url":"https://github.com/commenthol/secure-identifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/commenthol/secure-identifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fsecure-identifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fsecure-identifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fsecure-identifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fsecure-identifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/secure-identifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fsecure-identifier/sbom","scorecard":{"id":300840,"data":{"date":"2025-08-11","repo":{"name":"github.com/commenthol/secure-identifier","commit":"e1f85ff837f97d8f0cbaac5cd09c6a6f6d8d08e6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/13 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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}}]},"last_synced_at":"2025-08-17T20:35:13.095Z","repository_id":57371749,"created_at":"2025-08-17T20:35:13.095Z","updated_at":"2025-08-17T20:35:13.095Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32894847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":["identifier","mechanism","rfc-2142","secure","security","tr39","unicode","username"],"created_at":"2024-11-11T11:22:40.776Z","updated_at":"2026-05-11T12:34:11.312Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# secure-identifier\n\n\u003e secure identifier for usernames\n\n[![NPM version](https://badge.fury.io/js/secure-identifier.svg)](https://www.npmjs.com/package/secure-identifier/)\n[![Build Status](https://secure.travis-ci.org/commenthol/secure-identifier.svg?branch=master)](https://travis-ci.org/commenthol/secure-identifier)\n\nGenerates a unique and secure identifier for usernames, login-IDs, public-IDs and accounts by:\n\n1. Normalizing confusable chars from [Unicode Security Mechanisms TR39][]\n2. Perform case-folding according to [5.18 Case Mappings - Unicode 10.0](http://www.unicode.org/versions/Unicode10.0.0/ch05.pdf)\n3. Check for allowed symbols in accordance with [Unicode Security Mechanisms TR39][]\n4. Check length of input - default is (min: 2 chars, max: 60 chars)\n5. Check the sanitized string against a list of reserved words\n6. Only if all checks pass, the secured identifier is returned\n\nThis secure identifier shall be stored alongside the username/ loginId to ensure uniqueness amongst the whole set.\n\n## Further reading...\n\nFor the complexity of a valid usernames I recommend [Let’s talk about usernames][] which also inspired me for this project.\nTo read about where to use such identifier check [The Tripartite Identity Pattern][].\n\n## Usage\n\nFor use in your project:\n\n```\nnpm i -S secure-identifier\n```\n\nThen:\n\n```js\nconst {secureIdentifier} = require('secure-identifier')\n\nconst username = '\\u{1D5A2}\\u{1D5C2}\\u{1D5CB}\\u{1D5BC}\\u{1D5C5}\\u{1D5BE}'\n//\u003e 𝖢𝗂𝗋𝖼𝗅𝖾 - looks like Circle but isn`t\nconst secure = secureIdentifier(username)\n//\u003e secure === 'circle'\n```\n\n## API\n\nApart from the simple `secureIdentifier` you can use `Identifier` for mor advanced use-cases.\n\n```js\nconst {Identifier} = require('secure-identifier')\n\nconst username = ' Аᖯ𝗎𝗌е'\nconst opts = {minLength: 3, maxLength: 20}\nconst ident = new Identifier(username, opts)\n  ident.confusables().trim()\n    //\u003e 'Abuse'\n    .caseFolding()\n    //\u003e 'abuse'\n\n  ident.status() // get list of offending chars\n  //\u003e []\n  ident.isReserved() // 'abuse' is in the list of reserved names\n  //\u003e true\n  ident.isValid()\n  //\u003e false\n  ident.isMinLength() // check for minLength \u003e= 3\n  //\u003e true\n  ident.isMaxLength() // check for maxLength \u003c= 20\n  //\u003e true\n  ident.toString() // get current string\n  //\u003e 'abuse'\n  ident.valid() // get valid string\n  //\u003e undefined\n```\n\nPlease check out `./src/Identifier.js` and `./src/IdentifierBase.js` for further methods.\n\nIt is also possible to use your own list of reserved words. See `./test/Identifier.spec.js`\n\n## License\n\n[MIT licensed](./LICENSE.md)\n\n## References\n\n- [Unicode Security Mechanisms TR39][]\n- [Let’s talk about usernames][]\n- [The Tripartite Identity Pattern][]\n- [JavaScript has a Unicode problem][]\n\nReserved-names-lists are from:\n\n- https://ldpreload.com/blog/names-to-reserve\n-  https://zimbatm.github.io/hostnames-and-usernames-to-reserve/ (CC0)\n- http://blog.postbit.com/reserved-username-list.html\n- http://www.bannedwordlist.com/lists/swearWords.txt (Free)\n\n[Unicode Security Mechanisms TR39]: https://www.unicode.org/reports/tr39/\n[Let’s talk about usernames]: https://www.b-list.org/weblog/2018/feb/11/usernames/\n[The Tripartite Identity Pattern]: http://habitatchronicles.com/2008/10/the-tripartite-identity-pattern/\n[JavaScript has a Unicode problem]: https://mathiasbynens.be/notes/javascript-unicode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fsecure-identifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fsecure-identifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fsecure-identifier/lists"}