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 de66b7fe..8f1d342f 100644
--- a/docs/hazmat/primitives/cryptographic-hashes.rst
+++ b/docs/hazmat/primitives/cryptographic-hashes.rst
@@ -12,10 +12,19 @@ Message Digests
.. class:: BaseHash(data=None)
- Abstract base class that implements a common interface for all hash
- algorithms that follow here.
+ Abstract base class that implements a common interface for all hash
+ algorithms that follow here.
- If ``data`` is provided ``update(data)`` is called upon construction.
+ If ``data`` is provided ``update(data)`` is called upon construction.
+
+ .. doctest::
+
+ >>> from cryptography.hazmat.primitives import hashes
+ >>> digest = hashes.SHA256()
+ >>> digest.update(b"abc")
+ >>> digest.update(b"123")
+ >>> digest.hexdigest()
+ '6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090'
.. method:: update(data)