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 2020
2121from io import BytesIO
2222
23+ from bitcoin .core .contrib .ripemd160 import ripemd160
24+
2325MAX_SIZE = 0x02000000
2426
2527
@@ -29,17 +31,6 @@ def Hash(msg):
2931
3032def Hash160 (msg ):
3133 """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-
4334 return ripemd160 (hashlib .sha256 (msg ).digest ())
4435
4536class SerializationError (Exception ):
You can’t perform that action at this time.
0 commit comments