parent
08f0156b75
commit
0a9db22828
11 changed files with 31 additions and 23 deletions
@ -1,3 +1,3 @@ |
|||||||
name = "basicswap" |
name = "basicswap" |
||||||
|
|
||||||
__version__ = "0.12.1" |
__version__ = "0.12.2" |
||||||
|
@ -1,13 +1,23 @@ |
|||||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||||
|
|
||||||
# Copyright (c) 2022 tecnovert |
# Copyright (c) 2022-2023 tecnovert |
||||||
# Distributed under the MIT software license, see the accompanying |
# Distributed under the MIT software license, see the accompanying |
||||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php. |
# file LICENSE or http://www.opensource.org/licenses/mit-license.php. |
||||||
|
|
||||||
from Crypto.Hash import RIPEMD160 # pycryptodome |
from Crypto.Hash import RIPEMD160, SHA256 # pycryptodome |
||||||
|
|
||||||
|
|
||||||
|
def sha256(data): |
||||||
|
h = SHA256.new() |
||||||
|
h.update(data) |
||||||
|
return h.digest() |
||||||
|
|
||||||
|
|
||||||
def ripemd160(data): |
def ripemd160(data): |
||||||
h = RIPEMD160.new() |
h = RIPEMD160.new() |
||||||
h.update(data) |
h.update(data) |
||||||
return h.digest() |
return h.digest() |
||||||
|
|
||||||
|
|
||||||
|
def hash160(s): |
||||||
|
return ripemd160(sha256(s)) |
||||||
|
Loading…
Reference in new issue