hmac.update()
hmac.update() is a Python method in the Hmac Module category. Updates the HMAC object with additional data. The syntax is hmac.update(msg). Parameters: msg — bytes. Returns: None. A typical example: h = hmac.new(b"key", digestmod="sha256")
h.update(b"part1 ")
h.update(b"part2")
h.hexdigest(). A close sibling is hmac.new(), which creates a new HMAC object for message authentication. A close sibling is hmac.digest(), which returns the digest as bytes. A close sibling is hmac.hexdigest(), which returns the digest as a hexadecimal string. A close sibling is hmac.compare_digest(), which constant-time comparison to prevent timing attacks. More about this category: HMAC message authentication — new, digest, hexdigest, compare_digest. Related Hmac Module entries: hmac.new(), hmac.digest(), hmac.hexdigest(), hmac.compare_digest(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try hmac.update() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.