Skip to content

Instantly share code, notes, and snippets.

@hivelogic2018
Created September 28, 2025 04:32
Show Gist options
  • Select an option

  • Save hivelogic2018/eda72015fcf29adc38cec4f74a355f81 to your computer and use it in GitHub Desktop.

Select an option

Save hivelogic2018/eda72015fcf29adc38cec4f74a355f81 to your computer and use it in GitHub Desktop.
hashing with argon2.js
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