From 5560298b42f071db0bf7ea46c63ff52603370b38 Mon Sep 17 00:00:00 2001 From: David Reid Date: Fri, 1 Nov 2013 13:34:05 -0700 Subject: Improve Hash documentation. --- docs/hazmat/primitives/cryptographic-hashes.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'docs/hazmat') diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst index 9bbac247..a939998d 100644 --- a/docs/hazmat/primitives/cryptographic-hashes.rst +++ b/docs/hazmat/primitives/cryptographic-hashes.rst @@ -7,10 +7,16 @@ Message Digests .. class:: Hash(algorithm) - Abstract base class that implements a common interface for all hash - algorithms that follow here. + A cryptographic hash function takes an arbitrary block of data and + calculates a fixed-size bit string (a digest), such that different data + results (with a high probability) in different digests. - If ``data`` is provided ``update(data)`` is called upon construction. + This is an implementation of + :class:`cryptography.hazmat.primitives.interfaces.HashContext` meant to + be used with + :class:`cryptography.hazmat.primitives.interfaces.HashAlgorithm` + implementations to provide an incremental interface to calculating + various message digests. .. doctest:: @@ -30,6 +36,9 @@ Message Digests :return: a new instance of this object with a copied internal state. .. method:: finalize() + Finalize the current context and return the message digest as bytes. + + Once ``finalize`` is called this object can no longer be used. :return bytes: The message digest as bytes. -- cgit v1.2.3