1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-23 07:08:13 +00:00

ch10: Update hashlib excerpt for Python 3

This commit is contained in:
Will Binns 2021-03-09 21:24:41 +01:00
parent 65bd520926
commit d10161ab82
No known key found for this signature in database
GPG Key ID: 302EBEAEEB74A404

View File

@ -431,10 +431,10 @@ $ python
----
[source,pycon]
----
Python 2.7.1
Python 3.7.3
>>> import hashlib
>>> print hashlib.sha256("I am Satoshi Nakamoto").hexdigest()
5d7c7ba21cbbcd75d14800b100252d5b428e5b1213d27c385bc141ca6b47989e
>>> hashlib.sha256(b"I am Satoshi Nakamoto").hexdigest()
'5d7c7ba21cbbcd75d14800b100252d5b428e5b1213d27c385bc141ca6b47989e'
----
====