{"id":23955509,"url":"https://github.com/komiya-atsushi/rapidhash-js","last_synced_at":"2025-08-31T05:33:50.879Z","repository":{"id":257024053,"uuid":"819446349","full_name":"komiya-atsushi/rapidhash-js","owner":"komiya-atsushi","description":"A TypeScript implementation of the rapidhash.","archived":false,"fork":false,"pushed_at":"2025-05-29T00:27:57.000Z","size":2198,"stargazers_count":11,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T14:16:04.312Z","etag":null,"topics":["hash","hash-functions","rapidhash"],"latest_commit_sha":null,"homepage":"","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/komiya-atsushi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-06-24T14:16:39.000Z","updated_at":"2025-06-17T00:35:52.000Z","dependencies_parsed_at":"2024-09-14T11:53:08.632Z","dependency_job_id":"930efa45-8c7d-4273-bb20-a0d2b6735786","html_url":"https://github.com/komiya-atsushi/rapidhash-js","commit_stats":null,"previous_names":["komiya-atsushi/rapidhash-js"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/komiya-atsushi/rapidhash-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komiya-atsushi%2Frapidhash-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komiya-atsushi%2Frapidhash-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komiya-atsushi%2Frapidhash-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komiya-atsushi%2Frapidhash-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komiya-atsushi","download_url":"https://codeload.github.com/komiya-atsushi/rapidhash-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komiya-atsushi%2Frapidhash-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272940978,"owners_count":25019015,"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-08-31T02:00:09.071Z","response_time":79,"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":["hash","hash-functions","rapidhash"],"created_at":"2025-01-06T15:33:08.439Z","updated_at":"2025-08-31T05:33:50.858Z","avatar_url":"https://github.com/komiya-atsushi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rapidhash-js\n\n[![npm version](https://badge.fury.io/js/rapidhash-js.svg)](https://badge.fury.io/js/rapidhash-js)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/komiya-atsushi/rapidhash-js/test.yaml)](https://github.com/komiya-atsushi/rapidhash-js/actions/workflows/test.yaml)\n[![NPM License](https://img.shields.io/npm/l/rapidhash-js)](https://opensource.org/licenses/MIT)\n\nA TypeScript implementation of the [Nicoshev/rapidhash](https://github.com/Nicoshev/rapidhash).\n\nRapidhash is a fast hashing algorithm that passes all tests in [SMHasher](https://github.com/rurban/smhasher) and [SMHasher3](https://gitlab.com/fwojcik/smhasher3).\n\n## Installation\n\n\n```bash\nnpm install rapidhash-js\n```\n\n## Usage\n\n```typescript\nimport {\n  // The functions rapidhash, rapidhash_fast, and rapidhash_protected currently implement the v2.2 algorithm.\n  rapidhash,\n  rapidhash_fast,\n  rapidhash_protected,\n  // To use the old v1 algorithm, import rapidhash_v1 (or rapidhash_v1_fast, rapidhash_v1_protected) instead.\n  rapidhash_v1,\n} from 'rapidhash-js';\n\n// rapidhash() returns a 64-bit hash value represented as bigint.\nconsole.log(rapidhash('hello world'));  // Output: 1722744455612372674n\n\n// You can specify a 64-bit seed value with the 'seed' option.\nconsole.log(rapidhash('hello world', {seed: 0x0123_4567_89AB_CDEFn}));  // Output: 13409940373860458135n\n\n// You can specify the behavior of the rapid_mum() function\n// with the rapidMumBehaviour option (default is 'fast').\nconsole.log(rapidhash('hello world', {rapidMumBehaviour: 'protected'}));  // Output: 12365338091610779222n\n\n// Instead of specifying the rapidMumBehaviour option,\n// you can call rapidhash_fast() or rapidhash_protected().\nconsole.log(rapidhash_protected('hello world'));\n```\n\n## Benchmark\n\n\u003cdetails\u003e\n\u003csummary\u003eApple M3 Max\u003c/summary\u003e\n\n```\n[Benchmark Environment]\n  Node.js: v22.15.1\n  CPU: Apple M3 Max (16 cores, 2400 MHz)\n\n[1-4 bytes]\n  [v1.0] rapidhash (fast)      : 6,285,122.13 ops/s (159.11 ns/iter)\n  [v1.0] rapidhash (protected) : 5,358,496.06 ops/s (186.62 ns/iter)\n  [v2.0] rapidhash (fast)      : 6,751,586.61 ops/s (148.11 ns/iter)\n  [v2.0] rapidhash (protected) : 5,503,585.53 ops/s (181.70 ns/iter)\n  [v2.2] rapidhash (fast)      : 6,713,669.81 ops/s (148.95 ns/iter)\n  [v2.2] rapidhash (protected) : 5,474,441.63 ops/s (182.67 ns/iter)\n\n[5-8 bytes]\n  [v1.0] rapidhash (fast)      : 5,995,195.47 ops/s (166.80 ns/iter)\n  [v1.0] rapidhash (protected) : 5,129,620.76 ops/s (194.95 ns/iter)\n  [v2.0] rapidhash (fast)      : 6,217,065.60 ops/s (160.85 ns/iter)\n  [v2.0] rapidhash (protected) : 5,326,035.89 ops/s (187.76 ns/iter)\n  [v2.2] rapidhash (fast)      : 6,050,308.59 ops/s (165.28 ns/iter)\n  [v2.2] rapidhash (protected) : 5,344,429.93 ops/s (187.11 ns/iter)\n\n[9-16 bytes]\n  [v1.0] rapidhash (fast)      : 5,986,726.82 ops/s (167.04 ns/iter)\n  [v1.0] rapidhash (protected) : 5,154,979.68 ops/s (193.99 ns/iter)\n  [v2.0] rapidhash (fast)      : 6,131,914.48 ops/s (163.08 ns/iter)\n  [v2.0] rapidhash (protected) : 5,321,633.57 ops/s (187.91 ns/iter)\n  [v2.2] rapidhash (fast)      : 6,247,440.63 ops/s (160.07 ns/iter)\n  [v2.2] rapidhash (protected) : 5,351,510.81 ops/s (186.86 ns/iter)\n\n[17-64 bytes]\n  [v1.0] rapidhash (fast)      : 3,843,646.47 ops/s (260.17 ns/iter)\n  [v1.0] rapidhash (protected) : 3,312,988.79 ops/s (301.84 ns/iter)\n  [v2.0] rapidhash (fast)      : 3,947,650.45 ops/s (253.32 ns/iter)\n  [v2.0] rapidhash (protected) : 3,390,062.69 ops/s (294.98 ns/iter)\n  [v2.2] rapidhash (fast)      : 4,039,784.70 ops/s (247.54 ns/iter)\n  [v2.2] rapidhash (protected) : 3,400,339.38 ops/s (294.09 ns/iter)\n\n[65-111 bytes]\n  [v1.0] rapidhash (fast)      : 2,539,382.14 ops/s (393.80 ns/iter)\n  [v1.0] rapidhash (protected) : 2,156,257.28 ops/s (463.77 ns/iter)\n  [v2.0] rapidhash (fast)      : 2,580,829.71 ops/s (387.47 ns/iter)\n  [v2.0] rapidhash (protected) : 2,186,335.35 ops/s (457.39 ns/iter)\n  [v2.2] rapidhash (fast)      : 2,545,090.54 ops/s (392.91 ns/iter)\n  [v2.2] rapidhash (protected) : 2,189,080.78 ops/s (456.81 ns/iter)\n\n[112-256 bytes]\n  [v1.0] rapidhash (fast)      : 1,518,423.71 ops/s (658.58 ns/iter)\n  [v1.0] rapidhash (protected) : 1,274,445.41 ops/s (784.66 ns/iter)\n  [v2.0] rapidhash (fast)      : 1,484,277.31 ops/s (673.73 ns/iter)\n  [v2.0] rapidhash (protected) : 1,258,892.94 ops/s (794.35 ns/iter)\n  [v2.2] rapidhash (fast)      : 1,525,211.09 ops/s (655.65 ns/iter)\n  [v2.2] rapidhash (protected) : 1,293,585.65 ops/s (773.05 ns/iter)\n\n[1M bytes]\n  [v1.0] rapidhash (fast)      : 356.49 ops/s (2.81 ms/iter)\n  [v1.0] rapidhash (protected) : 296.16 ops/s (3.38 ms/iter)\n  [v2.0] rapidhash (fast)      : 375.05 ops/s (2.67 ms/iter)\n  [v2.0] rapidhash (protected) : 309.03 ops/s (3.24 ms/iter)\n  [v2.2] rapidhash (fast)      : 374.26 ops/s (2.67 ms/iter)\n  [v2.2] rapidhash (protected) : 309.25 ops/s (3.23 ms/iter)\n```\n\n\u003c/details\u003e\n\n## License\n\nMIT License\n\nCopyright (c) 2025 KOMIYA Atsushi.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomiya-atsushi%2Frapidhash-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomiya-atsushi%2Frapidhash-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomiya-atsushi%2Frapidhash-js/lists"}