How to get MD5 sum of a string using python?
You can do the following:
Python 2.x
import hashlibprint hashlib.md5("whatever your string is").hexdigest()
Python 3.x
import hashlibprint(hashlib.md5("whatever your string is".encode('utf-8')).hexdigest())
However in this case you're probably better off using this helpful Python module for interacting with the Flickr API:
... which will deal with the authentication for you.
Official documentation of hashlib
You can use b
character in front of a string literal:
import hashlibprint(hashlib.md5(b"Hello MD5").hexdigest())print(hashlib.md5("Hello MD5".encode('utf-8')).hexdigest())
Out:
e5dadf6524624f79c3127e247f04b548e5dadf6524624f79c3127e247f04b548