pythondjangoccavenue

md5 not support in python 3.6 and django 1.10


I want to decrypt response received from CCavenue.In their refrence code they use md5 library but for django 1.10 with python 3.6 not supported.

import md5

ModuleNotFoundError: No module named 'md5'


Solution

  • In python3.x,you should use this:

    from hashlib import md5
    

    You can now feed this object with bytes-like objects (normally bytes) using the update() method.

    e.g.

    from hashlib import md5
    
    m = md5()
    m.update(b"Nobody")
    print(m.hexdigest())
    

    Module name: md5 .
    Rationale: Replaced by the 'hashlib' module.
    Date: 15-May-2007 .
    Documentation: Documented as deprecated as of Python 2.5, but listing in this PEP was neglected.DeprecationWarning raised as of Python 2.6.

    See more details from hashlib.