O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

md5

The md5 module implements RSA’s MD5 message-digest algorithm. MD5 takes a sequence of input text and produces a 128-bit hash value. To compute the hash value, create an md5 object using the new() function, feed data to it using the update() method, and then call the digest() method to get the hash value.

						new([string])

Returns a new md5 object. If string is present, update(string) is called.

An md5 object, m, has the following methods:

						m.update(arg)

Updates the md5 object m with the string arg.

						m.digest()

Returns the digest of all data passed to the object using the update() method and returns a 16-byte string that may contain nonprintable characters, including null bytes.

						m.hexdigest()

Returns the digest as a string of 32 hexadecimal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required