Skip to content

Instantly share code, notes, and snippets.

@cgmb
Created January 22, 2016 04:30
Show Gist options
  • Select an option

  • Save cgmb/8ca4094a820612fbba9b to your computer and use it in GitHub Desktop.

Select an option

Save cgmb/8ca4094a820612fbba9b to your computer and use it in GitHub Desktop.
A basic example of node-argon2 v0.4.1
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-ok",
"version": "0.0.1",
"description": "An example showing that node-argon2 v0.4.1 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.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment