jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 5942marine <>
Subject Re: Need helping creating a md5 hash
Date Sun, 21 Nov 2010 07:00:10 GMT

Deepak, I got it!

Before, I was using a Beanshell Pre Processor as a child of the Sampler.

But I tried using a Beanshell Sampler, right after the request sampler, and
now it's working, creating a md5 hash. 

Is that okay, the way i'm doing it, the only thing I notice is that in the
View Results in Tree, I see the Bean Shell Sampler.

But thank you, thank you!

Here's what I'm using, for a reference to anyone else.

import java.math.BigInteger;
String plaintext = vars.get("time") + "1js3kl23"; // Need to add a key to
the time that gets hashed
MessageDigest m = MessageDigest.getInstance("MD5");
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1,digest);
String hashtext = bigInt.toString(16);
// Now we need to zero pad it if you actually want the full 32 chars.
while(hashtext.length() < 32 ){
  hashtext = "0"+hashtext;
View this message in context:
Sent from the JMeter - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message