File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -91,24 +91,22 @@ library that Python uses on your platform. On most platforms the
91
91
92
92
Hashlib now uses SHA3 and SHAKE from OpenSSL 1.1.1 and newer.
93
93
94
- For example, to obtain the digest of the byte string ``b' Nobody inspects the
95
- spammish repetition' ``::
94
+ For example, to obtain the digest of the byte string ``b" Nobody inspects the
95
+ spammish repetition" ``::
96
96
97
97
>>> import hashlib
98
98
>>> m = hashlib.sha256()
99
99
>>> m.update(b " Nobody inspects" )
100
100
>>> m.update(b " the spammish repetition" )
101
101
>>> m.digest()
102
102
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
103
- >>> m.digest_size
104
- 32
105
- >>> m.block_size
106
- 64
103
+ >>> m.hexdigest()
104
+ '031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'
107
105
108
106
More condensed:
109
107
110
- >>> hashlib.sha224 (b " Nobody inspects the spammish repetition" ).hexdigest()
111
- 'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2 '
108
+ >>> hashlib.sha256 (b " Nobody inspects the spammish repetition" ).hexdigest()
109
+ '031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406 '
112
110
113
111
.. function :: new(name[, data], *, usedforsecurity=True)
114
112
You can’t perform that action at this time.
0 commit comments