为什么string的utf8编码会给出返回值不变的string

我的代码如下所示:

let createCipher = (req, res) => { const text = req.body.text; let hash = crypto.createHash('md5').update(utf8.encode(text)).digest('hex'); res.json({ status: '200', data: hash, utf: utf8.encode(text) }); } 

在这里,无论我给文本input参数,同样会在响应字段utf中返回。 那么utf8过程中有什么缺失?

 let createCipher = (req, res) => { const text = req.body.text; //text = "Hello World"; let hash = crypto.createHash('md5'); hash.update(utf8.encode(text)); //or you try //let hash = crypto.createHash('md5').update(utf8.encode(text)); let data = hash.digest('hex'); //console.log(data + ' ' + text); //console.log("utf8 - byte data : " + utf8.encode(data)+ ' ' + utf8.encode(text)); res.json({ status: '200', data: hash, utf: utf8.encode(data) //data }); } //Output //b10a8db164e0754105b7a99be72e3fe5 Hello World //utf8 - byte data : b10a8db164e0754105b7a99be72e3fe5 Hello World