Password Hashing in HonoJs #4088
Replies: 3 comments
-
|
In Node.JS just import or require bcrypt and use it as follows Example // 2. Hash the password using the salt // 3. Compare if password matches |
Beta Was this translation helpful? Give feedback.
-
|
Thank you Cholasni Anaim for your nice support.
The issue was in the installation process of bcrypt due to TypeScript.
Incorrect process: **npm install bcrypt**
Correct process: **npm i --save-dev @types/bcrypt**
Musadul Islam
Sr. Software Engineer
(BJIT LTD.)
…On Fri, Apr 18, 2025 at 1:28 AM Cholasni Anaim ***@***.***> wrote:
In *Node.JS* just import or require bcrypt and use it as follows
*import bcrypt from 'bcrypt';*
Example
// 1. Generate a salt
const saltRounds = 10; // Try an integer 10-12
const salt = await bcrypt.genSalt(saltRounds);
// 2. Hash the password using the salt
const hashedPassword = await bcrypt.hash(password, salt);
// 3. Compare if password matches
const passwordMatches = await bcrypt.compare(password,
userFromDatabase.hashedPassword);
—
Reply to this email directly, view it on GitHub
<#4088 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHUAIPW6BXTZ64J77CSZP3T2Z76HDAVCNFSM6AAAAAB3KLEUWWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOBXGEZDMNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Is any runtime agnostic lib for password hashing in hono @yusukebe ?, I want to write password hashing code in handle and I can deploy my server with every mordern runtimes ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What libraries are supported to hash passwords in hono js?
I tried to use bcrypt. But hono doesn't support it.
Beta Was this translation helpful? Give feedback.
All reactions