arkadaşlar txt dosyasındaki satır satır adres listesini RIPEMD-160 Hash nasıl toplu dönüştürme yapabilirim? Python ?
input.txt
adres
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
1KxUVU9DKfdaTLMnXBLS5BZRf56cFnRosk
....
....
....
output.txt
hash 160
cff01716e3b722613b3d017b9ed5da84d24e4fcf
cff01716e3b722613b3d017b9ed5da84d24e4fcf
cff01716e3b722613b3d017b9ed5da84d24e4fcf
cff01716e3b722613b3d017b9ed5da84d24e4fcf
cff01716e3b722613b3d017b9ed5da84d24e4fcf
cff01716e3b722613b3d017b9ed5da84d24e4fcf
....
....
....
input.txt de adresler, output.txt hash 160 dönüşümler satır satır... girdi ve çıktı bu şekilde olacak arkadaşlar (her bir satırı input.txt ten okuyup output.txt e yazdıracak)
import hashlib, binascii
from base58 import b58decode
address_file = 'input.txt'
output_file = 'output.txt'
all_content = None
with open(address_file) as f:
all_content = f.readlines()
all_results = []
with open(output_file, "w") as text_file:
for oneAdd in all_content:
btc_addr = oneAdd.strip()
decoded_btc_addr = b58decode(btc_addr)
decoded_hex = binascii.hexlify(decoded_btc_addr)
h160_result = decoded_hex[2:-8]
text_file.write(h160_result.decode()+"\n")
bu kod istediğin gibi input.txt den adresleri okuyup her bir satırdaki adres in ripemd 160 hashini alıp output.txt ye kaydetmeni sağlıyor. her bir satıra karşılık aynı satıra sonuç yazılıcaktır.
Detaylı bitcoin adres yapısı için buraya bakılabilir:
https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses