MultiversX Tracker is Live!

base58 encoding in python3

Bitcoin Reddit

More / Bitcoin Reddit 186 Views

I am trying to do base58 encoding in python3. I keep getting the wrong the address though, I get 1dBJFEKNo9qdsdBFFFTsZZ3RB353sq7Q as an actual result, however the expected result is 16dBJFEKNntR886iGzLWpRXfzF79wMgTQ . If anyone know why it is doing this, your help would be greatly appreciated.

prefix = "00"

pubkeyhash = "011047801e8c1da5d616cc96eda18190b1257c2a"

checksum = ad.hash256(prefix + pubkeyhash)[:8]

rawaddress = prefix + pubkeyhash + checksum

print(rawaddress)

print(ad.encode(rawaddress))

def encode(num):

encode = ""

t = ""

if num[0:2] == "00":

t = "1"

num = int(num, 16)

if (num < 0):

return "" 

while (num >= base_count):

mod = int(num % base\_count) encode = alphabet\[mod\] + encode num = num / base\_count 

return t + encode


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments