Author

Topic: base58 module up on the cheeseshop (python) (Read 1184 times)

newbie
Activity: 52
Merit: 0
Old post, but I reply anyway.

I just downloaded this package and tried to create a simple example to make sure I'm using it right. I took the RIPEMD-160 output from the Technical background for creating addresses and wrote this code:

Code:
import base58

data = "00010966776006953D5567439E5E39F86A0D273BEED61967F6"
print(base58.b58encode(data))
When run:
Code:
bSLesHPiFV9jKNeNbUiMyZGJm45zVSB8bSdogLWCmvs88wxHjEQituLz5daEGCrHE7R7

The Base58Check encoding should be "16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM", not the one above. So I tried this:

Code:
import base58

data = "00010966776006953D5567439E5E39F86A0D273BEED61967F6"
print(base58.b58encode_check(data))

When run:
Code:
4tLt7VRA9EvEYi3vrZSvS6ynpFmfLnFL4Ugx77ga4VPNFavt6T96TZxXwMrpGW2wj5gCWhkGYM

Does anyone know how to use this package correctly? Sadly, it lacks of instructions or a readme file.

Thanks.
newbie
Activity: 12
Merit: 0
Hi

I've seen many projects and created a few one of script myself where the variations of the same base58 encode/decode snippet is included. I took the liberty to package this up and added it to pypi so it's super easy to depend on it. As a added bonus I've added python3 support and made it usable as a command-line tool that behave similar to base64(1)

Cheers!

https://pypi.python.org/pypi/base58/
Jump to: