I'd like to use gravatar in my iPhone application. Is there anyway to generate a hexadecimal MD5 hash in Objective-C for iPhone? Using openssl on iPhone is a no-go.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- facebook error invalid key hash for some devices
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
This is how I did it before I removed it from my app:
It's only fair to add that I didn't write this myself. I found it somewhere on the internet but I didn't record where.
The code I used for generating the necessary MD5 hash is up on my github repository, in the CommonCrypto subfolder. There are a bunch of similar routines in there which will either show you how to use CommonCrypto or how to format strings of hex byte values, base-64, etc.
A potentially better way of generating the string would be:
If you're going to use the code in the answer above, however, I'd personally suggest changing the %02X's to %02x and forgoing the -lowercaseString call completely-- might as well generate the hex values lowercase to start with.