On Fri, 2002-09-06 at 14:44, Josh G wrote:

Ack, replace 

tmp = md.toString();

with 

tmp = new String(md.getBytes());


that's the code I'm using... otherwise i get "MD5 object from SUN" or
some such :)


> Wondering if there's any problems with JDK1.4 / tomcat's MD5 digest? I'm
> not getting any exceptions, but I get gobbeldegook instead of and MD5
> digest....  Here's a code snippet - am I doing anything wrong?
> 
>       String newvalue = "some text";
> 
>       MessageDigest md;
> 
>       try {
>               md = MessageDigest.getInstance("MD5");
>       } catch (Exception e) {
>               this.password = "CaCrMeDi!";//Can't create
>               return;
>       }
> 
>       md.update(newvalue.getBytes());
>       md.digest();
>       String tmp = md.toString();
> 
> 
> Cheers,
> -Josh
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to