diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-28 10:14:46 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-28 10:14:46 -0700 |
commit | 23d01a2d9de8c89afe0417512ffa82826c4a6f03 (patch) | |
tree | f82084cf615d73ff1bc1f4479b50b6902a48ae5b /docs/hazmat/primitives/cryptographic-hashes.rst | |
parent | 9d683f71433ca4f2a09052159dc10d2f2dcb3222 (diff) | |
download | cryptography-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.rst | 15 |
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) |