• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: URGENT, calculating MD5
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >URGENT, calculating MD5 (From: Amedeo Mantica <email@hidden>)

  • Prev by Date: URGENT, calculating MD5
  • Next by Date: Re: URGENT, calculating MD5
  • Previous by thread: URGENT, calculating MD5
  • Next by thread: Re: URGENT, calculating MD5
  • Index(es):
    • Date
    • Thread