Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 64321 invoked from network); 20 Nov 2010 12:23:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Nov 2010 12:23:36 -0000 Received: (qmail 28357 invoked by uid 500); 20 Nov 2010 12:24:07 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 28317 invoked by uid 500); 20 Nov 2010 12:24:06 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 28308 invoked by uid 99); 20 Nov 2010 12:24:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Nov 2010 12:24:06 +0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-iw0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Nov 2010 12:24:00 +0000 Received: by mail-iw0-f172.google.com with SMTP id 40so6225779iwn.31 for ; Sat, 20 Nov 2010 04:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=5tuh0Y5+FeMWFciURGcc1UpOOv+Hcym3Mex6kAb19co=; b=j5Fl1g3madTvxcnApTxIp+pc2jt0SmErtclTkYv9gsY5EmQkBLZxYXEyVjsTWM2ped +lUZBlsVWghJ/QCtOantINlS9Ue244p7mSI6hPonu3zPsZf9mVGP7Oui7kmGjLCufh8g o5EJOq4sFyz3mlIc+QZfFVTPT78cQB3rIeCDo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZUf/6Zoh3zMfL7YqnZ2m7+8mJbaMe4cNU1Ua42XBR8x5EsscohS8Qiznw0MbAaVOcl FD0um3c3Sletq5k3nsrKdfJ4AUjMgYk4s+yHQ7OZ2ZZJhG1EdodQ4PasFZcuEUJLxis3 meAsjU/iTpFmgccF70/lvdkFRGgK5fXW8CZZM= MIME-Version: 1.0 Received: by 10.231.34.13 with SMTP id j13mr3654390ibd.56.1290255818681; Sat, 20 Nov 2010 04:23:38 -0800 (PST) Received: by 10.231.79.134 with HTTP; Sat, 20 Nov 2010 04:23:38 -0800 (PST) In-Reply-To: References: <1290215661235-3273251.post@n5.nabble.com> Date: Sat, 20 Nov 2010 04:23:38 -0800 Message-ID: Subject: Re: Need helping creating a md5 hash From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=00221534c827bdf04904957b1740 --00221534c827bdf04904957b1740 Content-Type: text/plain; charset=ISO-8859-1 The code below is meant to be put in a beanshell (pre/post/listener/sampler) On Sat, Nov 20, 2010 at 4:23 AM, Deepak Shetty wrote: > Hi > import java.security.MessageDigest; > > String text = vars.get("text"); //assuming this is where your > variable is > > MessageDigest md = MessageDigest.getInstance("MD5"); > byte[] md5hash = new byte[32]; > md.update(text.getBytes("utf-8"), 0, text.length()); > md5hash = md.digest(); > > Should give you an MD5 hash. but how you convert your byte[] into something > else (like a hex string ) is dependent on how the receiving party expects it > > regards > deepak > > > > On Fri, Nov 19, 2010 at 5:14 PM, 5942marine wrote: > >> >> First time poster here. >> >> So my question is, how can I create a md5 hash of a variable that I get >> through a json response. I have the variable via regex saved to a >> parameter, >> but I need to md5 hash it, so my next call will suceed. >> >> I've been looking into loading a .jar or including some java in the >> beanshell, but I'm at a complete loss. >> >> Any help would be greatly appreciated. >> >> Thanks, >> -- >> View this message in context: >> http://jmeter.512774.n5.nabble.com/Need-helping-creating-a-md5-hash-tp3273251p3273251.html >> Sent from the JMeter - User mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org >> >> > --00221534c827bdf04904957b1740--