hmac

The hmac module provides support for HMAC (Keyed-Hashing for Message Authentication). HMAC is a mechanism used for message authentication that is built upon cryptographic hashing functions such as MD5 and SHA-1.

						new(key
						[,
						msg
						[,
						digest]])

Creates a new HMAC object. key is a string containing the starting key for the hash, msg contains initial data to process, and digest is a module that should be used for cryptographic hashing. By default, digest is md5. Normally, the initial key value is determined at random using a cryptographically strong random number generator.

An HMAC object, h, has the following methods:

						h.update(msg)

Adds the string msg to the HMAC object.

						h.digest()

Returns the digest of all data processed so far and returns ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.