{"id":13516925,"url":"https://github.com/lukeed/uuid","last_synced_at":"2025-10-09T18:25:02.971Z","repository":{"id":57861469,"uuid":"243721767","full_name":"lukeed/uuid","owner":"lukeed","description":"A tiny (~230B)and fast UUID (V4) generator for Node and the browser","archived":false,"fork":false,"pushed_at":"2024-09-27T06:13:03.000Z","size":44,"stargazers_count":396,"open_issues_count":3,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T04:54:45.983Z","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-02-28T09:11:03.000Z","updated_at":"2024-10-12T10:17:21.000Z","dependencies_parsed_at":"2024-01-20T18:37:29.596Z","dependency_job_id":"636c724d-0490-4dc0-a981-0b08f77fbf30","html_url":"https://github.com/lukeed/uuid","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"f6f88ef4183d72ea1266af4922596618931801ae"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/uuid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/uuid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuuid/sbom","scorecard":{"id":604553,"data":{"date":"2025-08-11","repo":{"name":"github.com/lukeed/uuid","commit":"f6f88ef4183d72ea1266af4922596618931801ae"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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/uuid/ci.yml/master?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/uuid/ci.yml/master?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":"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":"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":"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":"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"}}]},"last_synced_at":"2025-08-21T01:16:41.089Z","repository_id":57861469,"created_at":"2025-08-21T01:16:41.090Z","updated_at":"2025-08-21T01:16:41.090Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001940,"owners_count":26083226,"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-09T02:00:07.460Z","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-01T05:01:27.314Z","updated_at":"2025-10-09T18:25:02.945Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","readme":"# @lukeed/uuid ![CI](https://github.com/lukeed/uuid/workflows/CI/badge.svg) [![licenses](https://licenses.dev/b/npm/%40lukeed%2Fuuid)](https://licenses.dev/npm/%40lukeed%2Fuuid) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/uuid)](https://codecov.io/gh/lukeed/uuid)\n\n\u003e A tiny (~230B) and [fast](#benchmarks) UUID (v4) generator for Node and the browser.\n\nThis module offers two [modes](#modes) for your needs:\n\n* [`@lukeed/uuid`](#lukeeduuid)\u003cbr\u003e_The default is \"non-secure\", which uses `Math.random` to produce UUIDs._\n* [`@lukeed/uuid/secure`](#lukeeduuidsecure)\u003cbr\u003e_The \"secure\" mode produces cryptographically secure (CSPRNG) UUIDs using the current environment's `crypto` module._\n\n\u003e **Important:** \u003cbr\u003eVersion `1.0.0` only offered a \"secure\" implementation.\u003cbr\u003eIn `v2.0.0`, this is now exported as the `\"@lukeed/uuid/secure\"` entry.\n\nAdditionally, this module is preconfigured for native ESM support in Node.js with fallback to CommonJS. It will also work with any Rollup and webpack configuration.\n\n\n## Install\n\n```\n$ npm install --save @lukeed/uuid\n```\n\n## Modes\n\nThere are two \"versions\" of `@lukeed/uuid` available:\n\n#### `@lukeed/uuid`\n\u003e **Size (gzip):** 231 bytes\u003cbr\u003e\n\u003e **Availability:** [CommonJS](https://unpkg.com/@lukeed/uuid/dist/index.js), [ES Module](https://unpkg.com/@lukeed/uuid/dist/index.mjs), [UMD](https://unpkg.com/@lukeed/uuid/dist/index.min.js)\n\nRelies on `Math.random`, which means that, while faster, this mode **is not** cryptographically secure. \u003cbr\u003eWorks in Node.js and all browsers.\n\n#### `@lukeed/uuid/secure`\n\u003e **Size (gzip):** 235 bytes\u003cbr\u003e\n\u003e **Availability:** [CommonJS](https://unpkg.com/@lukeed/uuid/secure/index.js), [ES Module](https://unpkg.com/@lukeed/uuid/secure/index.mjs), [UMD](https://unpkg.com/@lukeed/uuid/secure/index.min.js)\n\nRelies on the environment's `crypto` module in order to produce cryptographically secure (CSPRNG) values. \u003cbr\u003eWorks in all versions of Node.js. Works in all browsers with [`crypto.getRandomValues()` support](https://caniuse.com/#feat=getrandomvalues).\n\n\n## Usage\n\n```js\nimport { v4 as uuid } from '@lukeed/uuid';\nimport { v4 as secure } from '@lukeed/uuid/secure';\n\nuuid(); //=\u003e '400fa120-5e9f-411e-94bd-2a23f6695704'\nuuid(); //=\u003e 'cd6ffb4d-2eda-4c84-aef5-71eb360ac8c5'\n\nsecure(); //=\u003e '8641f70e-8112-4168-9d81-d38170bfa612'\nsecure(); //=\u003e 'd175fabc-2a4d-475f-be56-29ba8104c2f2'\n```\n\n\n## API\n\n### uuid.v4()\nReturns: `string`\n\nCreates a new Version 4 (random) [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUID.\n\n\n## Benchmarks\n\n\u003e Running on Node.js v12.18.4\n\n```\nValidation:\n  ✔ String.replace(Math.random)\n  ✔ String.replace(crypto)\n  ✔ uuid/v4\n  ✔ @lukeed/uuid\n  ✔ @lukeed/uuid/secure\n\nBenchmark:\n  String.replace(Math.random)  x    381,358 ops/sec ±0.31% (93 runs sampled)\n  String.replace(crypto)       x     15,842 ops/sec ±1.16% (86 runs sampled)\n  uuid/v4                      x  1,259,600 ops/sec ±0.45% (91 runs sampled)\n  @lukeed/uuid                 x  6,384,840 ops/sec ±0.22% (95 runs sampled)\n  @lukeed/uuid/secure          x  5,439,096 ops/sec ±0.23% (98 runs sampled)\n```\n\n\u003e Running on Chrome v85.0.4183.121\n\n```\nValidation:\n  ✔ String.replace(Math.random)\n  ✔ uuid/v4\n  ✔ @lukeed/uuid\n  ✔ @lukeed/uuid/secure\n\nBenchmark:\n  String.replace(Math.random)  x    313,213 ops/sec ±0.58% (65 runs sampled)\n  uuid/v4                      x    302,914 ops/sec ±0.94% (64 runs sampled)\n  @lukeed/uuid                 x  5,881,761 ops/sec ±1.29% (62 runs sampled)\n  @lukeed/uuid/secure          x    852,939 ops/sec ±0.88% (65 runs sampled)\n```\n\n## Performance\n\nThe reason why this UUID.V4 implementation is so much faster is two-fold:\n\n1) It composes an output with hexadecimal pairs (from a cached dictionary) instead of single characters.\n2) It allocates a larger Buffer/ArrayBuffer up front (expensive) and slices off chunks as needed (cheap).\n\nThe `@lukeed/uuid/secure` module maintains an internal ArrayBuffer of 4096 bytes, which supplies **256** `uuid.v4()` invocations. However, the default module preallocates **256** invocations using less memory upfront. Both implementations will regenerate its internal allocation as needed.\n\nA larger buffer would result in higher performance over time, but I found this to be a good balance of performance and memory space.\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","funding_links":["https://github.com/sponsors/lukeed"],"categories":["JavaScript","Packages","ID \u0026 Unique IDs","Unique ID Generation"],"sub_categories":["Random","Others","Reactive Programming"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fuuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fuuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fuuid/lists"}