File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 20
20
21
21
from io import BytesIO
22
22
23
+ from bitcoin .core .contrib .ripemd160 import ripemd160
24
+
23
25
MAX_SIZE = 0x02000000
24
26
25
27
@@ -29,17 +31,6 @@ def Hash(msg):
29
31
30
32
def Hash160 (msg ):
31
33
"""RIPEME160(SHA256(msg)) -> bytes"""
32
- try :
33
- # This will fail with newer versions of OpenSSL such as included in
34
- # Ubuntu 22.04 as OpenSSL no longer includes ripemd160 by default.
35
- hashlib .new ('ripemd160' )
36
- def ripemd160 (msg ):
37
- return hashlib .new ('ripemd160' , msg ).digest ()
38
- except :
39
- # If OpenSSL ripemd160 provided by hashlib fails, use the pure
40
- # python implementation instead
41
- from bitcoin .core .contrib .ripemd160 import ripemd160
42
-
43
34
return ripemd160 (hashlib .sha256 (msg ).digest ())
44
35
45
36
class SerializationError (Exception ):
You can’t perform that action at this time.
0 commit comments