Skip to content

Commit

Permalink
Fix examples for TupleHash
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Sep 23, 2023
1 parent 0d9a422 commit 07daa29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Doc/src/hash/tuplehash128.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ This is an example showing how to generate a TupleHash128 for the 3 bytes string
>>> print(hd.hexdigest())
4c095be894c21cfe7076a7d0fe3f70ed

A list or a tuple of byte strings can be submitted as well via the ``update()`` method.
This is an example::
Multiple byte strings can be submitted.
Each argument is a separate element in the tuple::

>>> from Crypto.Hash import TupleHash128
>>>
>>> hd = TupleHash128.new(digest_bytes=16)
>>> hd.update((b'deposit', b'100', b'joe'))
>>> hd.update(b'deposit', b'100', b'joe')
>>> print(hd.hexdigest())
4c095be894c21cfe7076a7d0fe3f70ed

Expand Down
6 changes: 3 additions & 3 deletions Doc/src/hash/tuplehash256.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ This is an example showing how to generate a TupleHash256 for the 3 bytes string
>>> print(hd.hexdigest())
b101225b7e5f1f086fc6d0be01abfa1e

A list or a tuple of byte strings can be submitted as well via the ``update()`` method.
This is an example::
Multiple byte strings can be submitted.
Each argument is a separate element in the tuple::

>>> from Crypto.Hash import TupleHash256
>>>
>>> hd = TupleHash128.new(digest_bytes=16)
>>> hd.update((b'deposit', b'100', b'joe'))
>>> hd.update(b'deposit', b'100', b'joe')
>>> print(hd.hexdigest())
b101225b7e5f1f086fc6d0be01abfa1e

Expand Down

0 comments on commit 07daa29

Please sign in to comment.