fork(2) download
  1. import base58
  2. import hashlib
  3. import sys
  4.  
  5. text = "1" + input()
  6.  
  7. try:
  8. base58.b58decode(text)
  9. except Exception as e:
  10. print("Contains not base58 charactor!")
  11. exit()
  12.  
  13. if len(base58.b58decode(text)) > 25:
  14. print("Too long text! Within 20.")
  15. exit()
  16.  
  17. while len(base58.b58decode(text)) < 25:
  18. text += "W"
  19.  
  20. decoded = base58.b58decode(text)
  21. chk = hashlib.sha256(hashlib.sha256(decoded[0:21]).digest()).digest()[0:4]
  22. checked_decoded = decoded[0:21] + chk
  23. print(base58.b58encode(checked_decoded).decode())
Runtime error #stdin #stdout #stderr 0.04s 9324KB
stdin
ChinkoMankoUnko
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'base58'