Skip to content

Instantly share code, notes, and snippets.

@cgmb
Created January 22, 2016 04:35
Show Gist options
  • Save cgmb/4027504aac16e86ffc61 to your computer and use it in GitHub Desktop.
Save cgmb/4027504aac16e86ffc61 to your computer and use it in GitHub Desktop.
A basic example of node-argon2 v0.4.2
var argon2 = require('argon2');
var pass = "password";
var salt = argon2.generateSaltSync();
var hash = argon2.encryptSync(pass, salt, {
timeCost: 3, memoryCost: 12, parallelism: 1
});
console.log(pass);
console.log(hash);
{
"name": "node-argon2-bug5-fail",
"version": "0.0.1",
"description": "An example showing that node-argon2 v0.4.2 installs correctly.",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Cordell Bloor <[email protected]>",
"private": true,
"dependencies": {
"argon2": "0.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment