{"id":47836327,"url":"https://github.com/shahradelahi/timing-safe-compare","last_synced_at":"2026-04-03T20:32:33.520Z","repository":{"id":337357659,"uuid":"1152492258","full_name":"shahradelahi/timing-safe-compare","owner":"shahradelahi","description":"🔐 Isomorphic constant-time string and buffer comparison to prevent timing attacks.","archived":false,"fork":false,"pushed_at":"2026-03-17T13:26:39.000Z","size":103,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T18:11:04.969Z","etag":null,"topics":["browser","constant-time","cryptography","isomorphic","nodejs","security","timing-attack"],"latest_commit_sha":null,"homepage":"https://npmjs.com/@se-oss/timing-safe-compare","language":"TypeScript","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/shahradelahi.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-08T00:23:49.000Z","updated_at":"2026-02-09T09:51:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/shahradelahi/timing-safe-compare","commit_stats":null,"previous_names":["shahradelahi/timing-safe-compare"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shahradelahi/timing-safe-compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Ftiming-safe-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Ftiming-safe-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Ftiming-safe-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Ftiming-safe-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahradelahi","download_url":"https://codeload.github.com/shahradelahi/timing-safe-compare/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahradelahi%2Ftiming-safe-compare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31375769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["browser","constant-time","cryptography","isomorphic","nodejs","security","timing-attack"],"created_at":"2026-04-03T20:32:33.430Z","updated_at":"2026-04-03T20:32:33.499Z","avatar_url":"https://github.com/shahradelahi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003csup\u003etiming-safe-compare\u003c/sup\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/shahradelahi/timing-safe-compare/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/shahradelahi/timing-safe-compare/actions/workflows/ci.yml/badge.svg?branch=main\u0026event=push\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@se-oss/timing-safe-compare\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@se-oss/timing-safe-compare.svg\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat\" alt=\"MIT License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/package/@se-oss/timing-safe-compare\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@se-oss/timing-safe-compare\" alt=\"npm bundle size\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://packagephobia.com/result?p=@se-oss/timing-safe-compare\"\u003e\u003cimg src=\"https://packagephobia.com/badge?p=@se-oss/timing-safe-compare\" alt=\"Install Size\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n_@se-oss/timing-safe-compare_ provides constant-time string and buffer comparison for Node.js and browsers to prevent timing attacks.\n\n---\n\n- [Installation](#-installation)\n- [Usage](#-usage)\n- [Documentation](#-documentation)\n- [Contributing](#-contributing)\n- [License](#license)\n\n## 📦 Installation\n\n```bash\nnpm install @se-oss/timing-safe-compare\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall using your favorite package manager\u003c/summary\u003e\n\n**pnpm**\n\n```bash\npnpm install @se-oss/timing-safe-compare\n```\n\n**yarn**\n\n```bash\nyarn add @se-oss/timing-safe-compare\n```\n\n\u003c/details\u003e\n\n## 📖 Usage\n\n### String Comparison\n\nCompare two strings in constant time. This is useful for comparing passwords, tokens, or any other sensitive data where the length is already known or handled.\n\n```ts\nimport { safeCompare } from '@se-oss/timing-safe-compare';\n\nif (safeCompare(inputPassword, storedPassword)) {\n  // Passwords match\n}\n```\n\n### Buffer Comparison\n\nCompare two `Uint8Array` (or `Buffer` in Node.js) instances in constant time. Note that both buffers must have the same length.\n\n```ts\nimport { timingSafeEqual } from '@se-oss/timing-safe-compare';\n\nconst a = new Uint8Array([1, 2, 3]);\nconst b = new Uint8Array([1, 2, 3]);\n\nif (timingSafeEqual(a, b)) {\n  // Buffers are equal\n}\n```\n\n## 📚 Documentation\n\nFor all configuration options, please see [the API docs](https://www.jsdocs.io/package/@se-oss/timing-safe-compare).\n\n## 🤝 Contributing\n\nWant to contribute? Awesome! To show your support is to star the project, or to raise issues on [GitHub](https://github.com/shahradelahi/timing-safe-compare).\n\nThanks again for your support, it is much appreciated! 🙏\n\n## License\n\n[MIT](/LICENSE) © [Shahrad Elahi](https://github.com/shahradelahi) and [contributors](https://github.com/shahradelahi/timing-safe-compare/graphs/contributors).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Ftiming-safe-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahradelahi%2Ftiming-safe-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahradelahi%2Ftiming-safe-compare/lists"}