Re: URGENT, calculating MD5
Re: URGENT, calculating MD5
- Subject: Re: URGENT, calculating MD5
- From: Piotr Intres <email@hidden>
- Date: Mon, 06 Mar 2006 21:43:39 +0100
Hi,
Your function is returning a String (array of bytes) and it works as is
written :)
Received strings look strange because the array may contain
non-character values and should not be displayed with .toString().
Try to display it as byte values - it should work just fine.
Regards,
Piotr Intres
Amedeo Mantica napisaĆ(a):
my function:
String calculateMd5 (String message)
{
MessageDigest myMAC = MessageDigest.getInstance("MD5");
byte[] messageBytes=message.getBytes();
myMAC.update(messageBytes);
byte[] result = myMAC.digest();
String calculatedMd5=result.toString();
return calculatedMd5;
}
I ALWAYS GOT A STRING LIKE "[B@6afa2"
any help?
Thanks
Amedeo
------------------------------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden