{"id":13606003,"url":"https://github.com/lukeed/hexoid","last_synced_at":"2025-10-09T18:23:31.664Z","repository":{"id":38236880,"uuid":"244595006","full_name":"lukeed/hexoid","owner":"lukeed","description":"A tiny (190B) and extremely fast utility to generate random IDs of fixed length","archived":false,"fork":false,"pushed_at":"2024-10-12T08:48:07.000Z","size":29,"stargazers_count":202,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T01:40:36.927Z","etag":null,"topics":[],"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/lukeed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"lukeed"}},"created_at":"2020-03-03T09:32:39.000Z","updated_at":"2025-09-30T19:30:00.000Z","dependencies_parsed_at":"2024-06-18T13:33:58.927Z","dependency_job_id":"e028d67b-5fc6-4ad1-9b16-0a1a5f6439d5","html_url":"https://github.com/lukeed/hexoid","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.040000000000000036","last_synced_commit":"a23cb66b42595b3c6c443ca2bbea9aac50504cc9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/hexoid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fhexoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fhexoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fhexoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fhexoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/hexoid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fhexoid/sbom","scorecard":{"id":604477,"data":{"date":"2025-08-11","repo":{"name":"github.com/lukeed/hexoid","commit":"a23cb66b42595b3c6c443ca2bbea9aac50504cc9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/25 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":"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":"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":10,"reason":"no dangerous workflow patterns detected","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/hexoid/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/hexoid/ci.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:20","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:28","Warn: downloadThenRun not pinned by hash: .github/workflows/ci.yml:35","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"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 'main'"],"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 1 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-21T01:15:45.607Z","repository_id":38236880,"created_at":"2025-08-21T01:15:45.607Z","updated_at":"2025-08-21T01:15:45.607Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278713770,"owners_count":26032950,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-08-01T19:01:05.126Z","updated_at":"2025-10-09T18:23:31.606Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","funding_links":["https://github.com/sponsors/lukeed"],"categories":["JavaScript","ID \u0026 Unique IDs","Unique ID Generation"],"sub_categories":["Reactive Programming"],"readme":"# hexoid [![CI](https://github.com/lukeed/hexoid/workflows/CI/badge.svg)](https://github.com/lukeed/hexoid/actions) [![licenses](https://licenses.dev/b/npm/hexoid)](https://licenses.dev/npm/hexoid) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/hexoid)](https://codecov.io/gh/lukeed/hexoid)\n\n\u003e A tiny (190B) and [extremely fast](#benchmarks) utility to generate random IDs of fixed length\n\n_**Hexadecimal object IDs.** Available for Node.js and the browser._\u003cbr\u003eGenerate randomized output strings of fixed length using lowercased hexadecimal pairs.\n\n\u003e **Notice:** Please note that this is not a cryptographically secure (CSPRNG) generator.\n\nAdditionally, this module is delivered as:\n\n* **CommonJS**: [`dist/index.js`](https://unpkg.com/hexoid/dist/index.js)\n* **ES Module**: [`dist/index.mjs`](https://unpkg.com/hexoid/dist/index.mjs)\n\n## Install\n\n```\n$ npm install --save hexoid\n```\n\n\n## Usage\n\n```js\nimport { hexoid } from 'hexoid';\n\nconst toID = hexoid();\n// length = 16 (default)\ntoID(); //=\u003e '52032fedb951da00'\ntoID(); //=\u003e '52032fedb951da01'\ntoID(); //=\u003e '52032fedb951da02'\n\n// customize length\nhexoid(25)(); //=\u003e '065359875047c63a037200e00'\nhexoid(32)(); //=\u003e 'ca8e4aec7f139d94fcab9cab2eb89f00'\nhexoid(48)(); //=\u003e 'c19a4deb5cdeca68534930e67bd0a2f4ed45988724d8d200'\n```\n\n\n## API\n\n### hexoid(length?)\nReturns: `() =\u003e string`\n\nCreates the function that will generate strings.\n\n#### length\nType: `Number`\u003cbr\u003e\nDefault: `16`\n\nThen length of the output string.\n\n\u003e **Important:** Your risk of collisions decreases with longer strings!\u003cbr\u003ePlease be aware of the [Birthday Problem](https://betterexplained.com/articles/understanding-the-birthday-paradox/)! You may need more combinations than you'd expect.\n\nThe **maximum combinations** are known given the following formula:\n\n```js\nconst combos = 256 ** (len/2);\n```\n\n\n## Benchmarks\n\n\u003e Running on Node.js v10.13.0\n\n```\nValidation (length = 16):\n  ✔ hashids/fixed        (example: \"LkQWjnegYbwZ1p0G\")\n  ✔ nanoid/non-secure    (example: \"sLlVL5X3M5k2fo58\")\n  ✔ uid                  (example: \"3d0ckwcnjiuu91hj\")\n  ✔ hexoid               (example: \"de96b62e663ef300\")\nBenchmark (length = 16):\n  hashids/fixed        x     349,462 ops/sec ±0.28% (93 runs sampled)\n  nanoid/non-secure    x   3,337,573 ops/sec ±0.28% (96 runs sampled)\n  uid                  x   3,553,482 ops/sec ±0.51% (90 runs sampled)\n  hexoid               x  81,081,364 ops/sec ±0.18% (96 runs sampled)\n\n\nValidation (length = 25):\n  ✔ cuid                 (example: \"ck7lj5hbf00000v7c9gox6yfh\")\n  ✔ hashids/fixed        (example: \"r9JOyLkQWjnegYbwZ1p0GDXNm\")\n  ✔ nanoid/non-secure    (example: \"hI202PVPJQRNrP6o6z4pXz4m0\")\n  ✔ uid                  (example: \"9904e9w130buxaw7n8358mn2f\")\n  ✔ hexoid               (example: \"01dfab2c14e37768eb7605a00\")\nBenchmark (length = 25):\n  cuid                 x     161,636 ops/sec ±1.36% (89 runs sampled)\n  hashids/fixed        x     335,439 ops/sec ±2.40% (94 runs sampled)\n  nanoid/non-secure    x   2,254,073 ops/sec ±0.23% (96 runs sampled)\n  uid                  x   2,483,275 ops/sec ±0.38% (95 runs sampled)\n  hexoid               x  75,715,843 ops/sec ±0.27% (95 runs sampled)\n\n\nValidation (length = 36):\n  ✔ uuid/v1              (example: \"c3dc1ed0-629a-11ea-8bfb-8ffc49585f54\")\n  ✔ uuid/v4              (example: \"8c89f0ca-f01e-4c84-bd71-e645bab84552\")\n  ✔ hashids/fixed        (example: \"EVq3Pr9JOyLkQWjnegYbwZ1p0GDXNmRBlAxg\")\n  ✔ @lukeed/uuid         (example: \"069ad676-48f9-4452-b11d-f20c3872dc1f\")\n  ✔ nanoid/non-secure    (example: \"jAZjrcDmHH6P1rT9EFdCdHUpF440SjAKwb2A\")\n  ✔ uid                  (example: \"5mhi30lgy5d0glmuy81llelbzdko518ow1sx\")\n  ✔ hexoid               (example: \"615209331f0b4630acf69999ccfc95a23200\")\nBenchmark (length = 36):\n  uuid/v1              x   1,487,947 ops/sec ±0.18% (98 runs sampled)\n  uuid/v4              x     334,868 ops/sec ±1.08% (90 runs sampled)\n  @lukeed/uuid         x   6,352,445 ops/sec ±0.27% (91 runs sampled)\n  hashids/fixed        x     322,914 ops/sec ±0.27% (93 runs sampled)\n  nanoid/non-secure    x   1,592,708 ops/sec ±0.25% (91 runs sampled)\n  uid                  x   1,789,492 ops/sec ±0.29% (92 runs sampled)\n  hexoid               x  71,746,692 ops/sec ±0.29% (93 runs sampled)\n```\n\n## Related\n\n- [uid](https://github.com/lukeed/uid) - A smaller (134B) but slower variant of this module with a different API\n- [@lukeed/uuid](https://github.com/lukeed/uuid) - A tiny (230B), fast, and cryptographically secure UUID (V4) generator for Node and the browser\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fhexoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fhexoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fhexoid/lists"}