{"id":22506614,"url":"https://github.com/a-poor/bcrypt-rsjs","last_synced_at":"2026-04-18T15:32:51.615Z","repository":{"id":57863637,"uuid":"526723074","full_name":"a-poor/bcrypt-rsjs","owner":"a-poor","description":"A bcrypt library for Node.js, written in Rust and Neon -- designed to replace bcrypt, which uses C++.","archived":false,"fork":false,"pushed_at":"2022-08-23T21:12:45.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T06:35:57.286Z","etag":null,"topics":["bcrypt","hash","javascript","nodejs","password"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-poor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-19T19:05:54.000Z","updated_at":"2022-08-23T20:49:15.000Z","dependencies_parsed_at":"2022-08-29T14:10:30.439Z","dependency_job_id":null,"html_url":"https://github.com/a-poor/bcrypt-rsjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fbcrypt-rsjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fbcrypt-rsjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fbcrypt-rsjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-poor%2Fbcrypt-rsjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-poor","download_url":"https://codeload.github.com/a-poor/bcrypt-rsjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944062,"owners_count":20697948,"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":["bcrypt","hash","javascript","nodejs","password"],"created_at":"2024-12-07T00:44:42.439Z","updated_at":"2026-04-18T15:32:51.585Z","avatar_url":"https://github.com/a-poor.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bcrypt-rsjs\n\n_created by Austin Poor_\n\nA [bcrypt](https://en.wikipedia.org/wiki/Bcrypt) library for Node.js, written in Rust and [Neon](https://neon-bindings.com/) - designed to replace [bcrypt](https://www.npmjs.com/package/bcrypt), which uses C++.\n\n## Example\n\n```js\nconst bcrypt = require('bcrypt-rsjs');\n\nconst my_password = 'Passw0rd';\nconst not_my_password = 'tell everyone';\n\n// Hash a password\nawait bcrypt.hash(my_password);\n// $2b$12$MF80o/X4kYVqS4psVu/eKO46fFm5hk6nhqwEykw/joHmR3A0DBX4q\n\n// Hash a password with a custom cost\nawait bcrypt.hash(my_password, 8);\n// $2b$08$zMIjSo9Gd62jtXlHR4eCkullNag4WFpK798jrpytD8Mb/dbW75Nk.\n\n// Validate a password\nawait bcrypt.compare(my_password, hash);\n// true\n\n// Validate a password\nawait bcrypt.compare(not_my_password, hash);\n// false\n```\n\n## Benchmarks\n\nBenchmarks were run for `bcrypt-rsjs` (this library), [bcrypt](https://www.npmjs.com/package/bcrypt) (uses C++), and [bcryptjs](https://www.npmjs.com/package/bcryptjs) (which is pure js).\n\nBased on the results below, `bcrypt-rsjs` has comparable performance to the C++ library. Tests can be rerun via `npm run bench`.\n\n### Sync Hash Benchmark\n\n*Runs `n` hashes in sequential order.*\n\n| name | func | cost | n tests | time (ms) | time/hash (ms) |\n| ---- | ----- | ----:| -------:| ---------:| --------------:|\n| `bcrypt` | `hashSync` | 8 | 1,000 | 12,061.86 | 12.06 |\n| `bcryptjs` | `hashSync` | 8 | 1,000 | 16,220.78 | 16.22 |\n| `bcrypt-rsjs` | `hashSync` | 8 | 1,000 | 12,717.00 | 12.72 |\n| `bcrypt` | `hashSync` | 12 | 100 | 19,437.58 | 194.38 |\n| `bcryptjs` | `hashSync` | 12 | 100 | 25,373.67 | 253.74 |\n| `bcrypt-rsjs` | `hashSync` | 12 | 100 | 19,902.50 | 199.03 |\n| `bcrypt` | `hashSync` | 16 | 10 | 30,637.60 | 3,063.76 |\n| `bcryptjs` | `hashSync` | 16 | 10 | 39,685.47 | 3,968.55 |\n| `bcrypt-rsjs` | `hashSync` | 16 | 10 | 31,941.44 | 3,194.14 |\n\n\n### Async Hash Benchmark\n\n*Runs `n` hashes simultaneously, via `Promise.all(hashes)`.*\n\n| name | func | cost | n tests | time (ms) | time/hash (ms) |\n| ---- | ----- | ----:| -------:| ---------:| --------------:|\n| `bcrypt` | `hash` | 8 | 1,000 | 3,283.85 | 3.28 |\n| `bcryptjs` | `hash` | 8 | 1,000 | 15,711.48 | 15.71 |\n| `bcrypt-rsjs` | `hash` | 8 | 1,000 | 3,316.77 | 3.32 |\n| `bcrypt` | `hash` | 12 | 100 | 5,126.82 | 51.27 |\n| `bcryptjs` | `hash` | 12 | 100 | 24,846.76 | 248.47 |\n| `bcrypt-rsjs` | `hash` | 12 | 100 | 5,245.11 | 52.45 |\n| `bcrypt` | `hash` | 16 | 10 | 9733.09 | 973.31 |\n| `bcryptjs` | `hash` | 16 | 10 | 39,921.91 | 3,992.19 |\n| `bcrypt-rsjs` | `hash` | 16 | 10 | 9,994.12 | 999.41 |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-poor%2Fbcrypt-rsjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-poor%2Fbcrypt-rsjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-poor%2Fbcrypt-rsjs/lists"}