aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/cryptographic-hashes.rst15
1 files changed, 12 insertions, 3 deletions
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.
#n85'>85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135