jmeter自带加密工具类DigestUtils

// md5
import
org.apache.commons.codec.digest.DigestUtils; String str = "${appid}" + "${appkey}" + "${salt}"; String sign = DigestUtils.md5Hex(str); vars.put("sign",sign);

 

// sha256
import
org.apache.commons.codec.digest.DigestUtils; String keytoSign = "需要进行加密的字符串"; String sign = DigestUtils.sha256Hex(keytoSign); log.info("================"+sign); vars.put("sign",sign);

 

posted @ 2020-04-22 17:16  Mosicol  Views(598)  Comments(0Edit  收藏  举报