In Node.js è semplice codificare una stringa in MD5.
La soluzione è la seguente:
'use strict';
const crypto = require('crypto');
const md5 = (value) => {
if(!value) {
return;
}
return crypto.createHash('md5').update(value).digest('hex');
};
module.exports = md5;