{"id":25935345,"url":"https://github.com/maxroecker/cruxhash","last_synced_at":"2025-10-14T11:42:00.333Z","repository":{"id":85099815,"uuid":"364418275","full_name":"MaxRoecker/cruxhash","owner":"MaxRoecker","description":"A set of crucial hash functions for ECMAScript.","archived":false,"fork":false,"pushed_at":"2024-01-04T13:02:00.000Z","size":499,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T12:38:43.063Z","etag":null,"topics":["ecmascript","hash","javascript","nodejs","typescript"],"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/MaxRoecker.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}},"created_at":"2021-05-05T00:05:09.000Z","updated_at":"2023-11-14T15:48:49.000Z","dependencies_parsed_at":"2024-10-27T23:46:44.615Z","dependency_job_id":"ca03b91e-7271-4497-926d-c0a3b76981e0","html_url":"https://github.com/MaxRoecker/cruxhash","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.09375,"last_synced_commit":"96ee756f28efeb68552f92c8459e69efa3a6ce62"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/MaxRoecker/cruxhash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fcruxhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fcruxhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fcruxhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fcruxhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxRoecker","download_url":"https://codeload.github.com/MaxRoecker/cruxhash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxRoecker%2Fcruxhash/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262337154,"owners_count":23296031,"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","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":["ecmascript","hash","javascript","nodejs","typescript"],"created_at":"2025-03-04T01:34:14.300Z","updated_at":"2025-10-14T11:41:55.313Z","avatar_url":"https://github.com/MaxRoecker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRUXHash\n\n[![View on NPM](https://img.shields.io/npm/v/cruxhash?style=flat-square)](https://www.npmjs.com/package/cruxhash)\n[![License](https://img.shields.io/npm/l/cruxhash?style=flat-square)](https://maxroecker.mit-license.org/)\n\nA set of crucial hash functions for ECMAScript.\n\n## Installation\n\nUse the npm package manager to install CRUXHash.\n\n```bash\nnpm i cruxhash\n```\n\n## Usage\n\nCRUXHash provides a set of simple functions to create unsigned 32-bit integer\nhash codes for trivial ECMAScript values. See the example bellow:\n\n```js\nimport { hash, getSeed } from 'cruxhash';\n\nconsole.log(hash('Smile, my dear!')); // returns 2890382619\n\nconsole.log(hash(42)); // returns 1462734105\n\nconsole.log(hash(42, getSeed('my seed'))); // returns 8142968\n\nconsole.log(hash({ a: 10, b: 10 })); // returns 3685477545\n\nconsole.log(hash([1, 2, 3])); // returns 2610324319\n\nconsole.log(hash('コンニチハ, Hello world, Καλημέρα κόσμε 😀')); // returns 1898574527\n```\n\nMost of times, the function [`hash`][hash] is sufficient for making the hash\ncodes. If you need some tampering, pass a number to the `seed` parameter to\nstart the hash algorithm. You can use the the [`getSeed`][getSeed] function to\ngenerate some seeds from strings. Other functions are available, see the\n[Wiki's Page][Wiki] for the complete API.\n\nCRUXHash uses [Murmur3][Murmur3] as the hashing algorithm in most of cases, the\nexception is when hashing 32bit integers, where it uses [Thomas Wang's][Wang]\nshift and multiplication algorithm.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to\ndiscuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://maxroecker.mit-license.org/)\n\n[Wang]: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm\n[Murmur3]: https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp\n[Wiki]: https://github.com/MaxRoecker/cruxhash/wiki\n[hash]: https://github.com/MaxRoecker/cruxhash/wiki#hash\n[getSeed]: https://github.com/MaxRoecker/cruxhash/wiki#getseed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxroecker%2Fcruxhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxroecker%2Fcruxhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxroecker%2Fcruxhash/lists"}