Title: Replace bcrypt with bcryptjs for better cross-platform compatibility · Issue #90 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Replace bcrypt with bcryptjs for better cross-platform compatibility · Issue #90 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Replace bcrypt with bcryptjs for better cross-platform compatibility · Issue #90 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Problem JavaScriptSolidServer currently uses bcrypt as the primary password hashing library, with bcryptjs as a fallback. However, bcrypt is a native C++ module that requires compilation, which causes installation failures on several pla...
Open Graph Description: Problem JavaScriptSolidServer currently uses bcrypt as the primary password hashing library, with bcryptjs as a fallback. However, bcrypt is a native C++ module that requires compilation, which cau...
X Description: Problem JavaScriptSolidServer currently uses bcrypt as the primary password hashing library, with bcryptjs as a fallback. However, bcrypt is a native C++ module that requires compilation, which cau...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/90
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Replace bcrypt with bcryptjs for better cross-platform compatibility","articleBody":"## Problem\n\nJavaScriptSolidServer currently uses `bcrypt` as the primary password hashing library, with `bcryptjs` as a fallback. However, `bcrypt` is a native C++ module that requires compilation, which causes installation failures on several platforms:\n\n### Platforms Affected\n- ✅ **Termux/Android** - Fails with `gyp: Undefined variable android_ndk_path`\n- ✅ **Windows** - Common compilation errors with node-gyp\n- ✅ **ARM devices** - Various build issues\n- ✅ **Restricted environments** - No build tools available\n\n### Current Behavior\nWhen users try to install JavaScriptSolidServer (or wrappers like jspod/fastpod) on these platforms:\n\n```\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\nnpm ERR! code 1\n```\n\nThis completely blocks installation, even though `bcryptjs` is already in the dependencies.\n\n## Proposed Solution\n\n**Switch to bcryptjs as the primary/only password hashing library.**\n\n### Why This Makes Sense\n\n1. **Minimal Performance Impact**\n - bcrypt (C++): ~100ms per hash\n - bcryptjs (JS): ~130ms per hash\n - **Difference: 30ms** - only during login/registration (rare operations)\n\n2. **Better User Experience**\n - No compilation errors\n - Works everywhere Node.js runs\n - Faster npm install (no build step)\n - Same security guarantees\n\n3. **Real-World Usage**\n - Password hashing happens maybe 1-10 times per day per user\n - File operations happen thousands of times per day\n - The 30ms difference is completely negligible\n\n4. **Already a Dependency**\n - bcryptjs is already in package.json\n - No new dependencies needed\n - Just remove bcrypt\n\n### Security\n\nBoth libraries implement the same bcrypt algorithm with the same security properties:\n- ✅ Salt generation\n- ✅ Configurable work factor\n- ✅ Resistance to timing attacks\n- ✅ Industry-standard algorithm\n\nThe only difference is implementation language (C++ vs JavaScript).\n\n## Testing\n\nTested on:\n- ✅ Termux/Android (ARM64, Android 15) - **Currently fails with bcrypt**\n- ✅ Linux (works with both)\n- ✅ Expected to fix Windows issues as well\n\n## Implementation\n\nChange from:\n```json\n\"dependencies\": {\n \"bcrypt\": \"^6.0.0\",\n \"bcryptjs\": \"^3.0.3\"\n}\n```\n\nTo:\n```json\n\"dependencies\": {\n \"bcryptjs\": \"^3.0.3\"\n}\n```\n\nAnd update all `require('bcrypt')` to `require('bcryptjs')`.\n\n## Impact\n\nThis would enable:\n- 📱 Running Solid pods on Android/Termux\n- 💻 Easier installation on Windows\n- 🌍 Better cross-platform support overall\n- ⚡ Faster installation (no compilation)\n\nWith virtually zero downside (30ms during infrequent auth operations).\n\n---\n\n**Use Case:** Trying to run `npx fastpod` on Termux fails due to bcrypt compilation. This blocks the entire \"just works\" philosophy of having a zero-config Solid server.","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-16T12:03:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/90/JavaScriptSolidServer/issues/90"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d22b4bfe-0644-a69a-c572-932d2a7aa3f8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B9A0:3F22BC:48C402:6399F3:697BD0D3 |
| html-safe-nonce | 0ce03dcec2be516224ee9a75096f317f8634f0c7511a7884b37959df10fe9b1e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUEwOjNGMjJCQzo0OEM0MDI6NjM5OUYzOjY5N0JEMEQzIiwidmlzaXRvcl9pZCI6IjQwODg4MDg3MTI5NDI4OTk0MTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 379cb1988dea31d46d5c26c8a0f375bbad5313a071781ee5d46aac7e998f8fcf |
| hovercard-subject-tag | issue:3821757928 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/90/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a5e0d98c73988c3b6ae1edc04c584d6e0b48105fcb290c6e63a3a9419871bb6/JavaScriptSolidServer/JavaScriptSolidServer/issues/90 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a5e0d98c73988c3b6ae1edc04c584d6e0b48105fcb290c6e63a3a9419871bb6/JavaScriptSolidServer/JavaScriptSolidServer/issues/90 |
| og:image:alt | Problem JavaScriptSolidServer currently uses bcrypt as the primary password hashing library, with bcryptjs as a fallback. However, bcrypt is a native C++ module that requires compilation, which cau... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 88b7b3079ea5046bb661ad315dabef17ecc28e5f9f988d30044f4f6e56520728 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42cddef55c232612d1a39797b85abf955112a1b4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width