如何在JMETER中将浮点转换为十六进制

问题描述 投票:0回答:1

如何在JMETER中将浮动变量转换为十六进制。

任何想法,谢谢。

jmeter ascii non-ascii-characters
1个回答
0
投票

[JMeter Distribution捆绑包中有Commons Codec库,它提供了Hex类,而该类又公开了encodeHex() function,您可以使用该类将ASCII字符串转换为其十六进制表示,例如:

鉴于您需要转换LLOP123344字符串,足以调用上述函数,例如:

org.apache.commons.codec.binary.Hex.encodeHexString('LLOP123344'.getBytes('UTF-8'))

返回4c4c4f50313233333434

enter image description here

更多信息:Apache Groovy - Why and How You Should Use It

© www.soinside.com 2019 - 2024. All rights reserved.