-
-
Save PlasmaPower/f3cc2c06875eee760d81 to your computer and use it in GitHub Desktop.
Argon2 with HTTP (doesn't work)
This file contains 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
'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