我找不到我的問題的具體例子
我需要在 NodeJS 中轉換這一行 PHP :
if (md5($value1.$value2.$value3.$value4.$value5) != $value)
我已經使用了幾個沒有成功的東西,比如CryptoJS.HmacMD5,CryptoJS.MD5或者md5
我覺得NodeJS有點復雜,值對應于我檢索的url中的查詢express,req.query.value_1......
uj5u.com熱心網友回復:
這應該作業
const crypto = require('crypto');
const data = "value";
const hash = crypto.createHash('md5').update(data).digest("hex");
if (hash != "value") { }
PS:你不需要安裝它,因為它已經隨 Node
uj5u.com熱心網友回復:
使用crypto自NPM
npm i crypto
const crypto = require('crypto');
let strToMd5 = str1 str2 str4;
let hashedStr = crypto.createHash('md5').update(strToMd5).digest('hex');
if(hashedStr != value){
// code
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/494820.html
標籤:javascript php 节点.js
上一篇:使用React向下滾動時加寬影像
