kalpita
kalpita

Reputation: 53

password in md5 format in mongodb+nodejs

I want to save password in md5 format can anyone tell me how it is possible in mongodb? I have used bcrypt and salt but the format of my password is not md5

Upvotes: 0

Views: 2034

Answers (1)

Gabriel Diez
Gabriel Diez

Reputation: 1692

In NodeJS you can use Crypto library doing this

var crypto = require('crypto');

var password = 'my Password';
var hash = crypto.createHash('md5').update(password).digest('hex');

You can have more informations about this method here crypto.createHash

Upvotes: 1

Related Questions