aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/cryptographic-hashes.rst
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-28 10:14:46 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-28 10:14:46 -0700
commit23d01a2d9de8c89afe0417512ffa82826c4a6f03 (patch)
treef82084cf615d73ff1bc1f4479b50b6902a48ae5b /docs/hazmat/primitives/cryptographic-hashes.rst
parent9d683f71433ca4f2a09052159dc10d2f2dcb3222 (diff)
downloadcryptography-23d01a2d9de8c89afe0417512ffa82826c4a6f03.tar.gz
cryptography-23d01a2d9de8c89afe0417512ffa82826c4a6f03.tar.bz2
cryptography-23d01a2d9de8c89afe0417512ffa82826c4a6f03.zip
example of how to use hashes
Diffstat (limited to 'docs/hazmat/primitives/cryptographic-hashes.rst')
-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)