How to get MD5 sum of a string using python?

后端 未结 6 1247
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 09:07

In the Flickr API docs, you need to find the MD5 sum of a string to generate the [api_sig] value.

How does one go about generating an MD5 sum from a str

6条回答
  •  悲哀的现实
    2020-11-27 10:01

    For Python 2.x, use python's hashlib

    import hashlib
    m = hashlib.md5()
    m.update("000005fab4534d05api_key9a0554259914a86fb9e7eb014e4e5d52permswrite")
    print m.hexdigest()
    

    Output: a02506b31c1cd46c2e0b6380fb94eb3d

提交回复
热议问题