Search code examples
iosxcodeswiftios9md5

how to use md5 format retrieved from json in iOS app


I've never used md5 format and i don't know how to decode it to get the string that is in response. How can i get the string from the md5 format? I'm using swift language on Xcode for iOS app development. If there is any library that can be used please do suggest it.

TIA


Solution

  • You can't decode MD5. What you can do instead is comparing the MD5 string from your JSON with a MD5(stringInYourApp). That means that if you want to compare the user input (for example) and the MD5 from your JSON you'll have to :

    • Make a MD5 version of user input string (see here for how to)
    • Compare it with the MD5 from JSON

    You cannot see the original string from a MD5 hash.