Skip to content

Instantly share code, notes, and snippets.

@PlasmaPower
Created March 3, 2016 14:34
Show Gist options
  • Save PlasmaPower/f3cc2c06875eee760d81 to your computer and use it in GitHub Desktop.
Save PlasmaPower/f3cc2c06875eee760d81 to your computer and use it in GitHub Desktop.
Argon2 with HTTP (doesn't work)
'use strict';
const argon2 = require('argon2');
const http = require('http');
function argon() {
return argon2.generateSalt().then(salt => {
console.log('SALT: ', salt);
return argon2.hash('some@test.com', salt).then(hash => {
console.log('HASH: ', hash);
return argon2.verify(hash, 'some@test.com');
});
});
}
http.createServer(function (req, res) {
argon().then(function () {
res.send('ok');
})
}).listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment