You need to sign in to do that
Don't have an account?

MD5 Encode doesn't match expected result
I'm trying to MD5 encode a key for an external request. However, I must be doing something wrong because my key doesn't match the one that the service is expecting. I think it has something to do with having to make the string into a blob before using the generateDigest function.
Here's my code:
string keystring = 'StJoApuytj2ih48p3062010'; Blob keyblob = Blob.valueof(keystring); Blob key = Crypto.generateDigest('MD5',keyblob); System.Debug('Key: '+key.toString());
When I run this keystring through another website, I get this key: fdb338dff10d6619a3516b627ebbfc2c
When I run this keystring through Salesforce I get this: �8�� f�Qkb~��
Anybody know how to get them to match?
You probably need to call encodingUtil.convertToHex on the resulting blob.