Created
September 28, 2025 04:32
-
-
Save hivelogic2018/eda72015fcf29adc38cec4f74a355f81 to your computer and use it in GitHub Desktop.
hashing with argon2.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const argon2 = require('argon2'); | |
| const readline = require('readline'); | |
| async function hashPassword() { | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout, | |
| }); | |
| const password = await new Promise(resolve => { | |
| rl.question('Enter password to hash: ', resolve); | |
| }); | |
| rl.close(); | |
| try { | |
| const hash = await argon2.hash(password); | |
| console.log(hash); | |
| } catch (err) { | |
| console.error('Error hashing password:', err); | |
| } | |
| } | |
| hashPassword(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment