Bitcoin Forum
October 22, 2018, 01:19:44 PM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: base58 module up on the cheeseshop (python)  (Read 1112 times)
keis
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
June 15, 2013, 04:48:19 PM
 #1

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/
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1540214384
Hero Member
*
Offline Offline

Posts: 1540214384

View Profile Personal Message (Offline)

Ignore
1540214384
Reply with quote  #2

1540214384
Report to moderator
1540214384
Hero Member
*
Offline Offline

Posts: 1540214384

View Profile Personal Message (Offline)

Ignore
1540214384
Reply with quote  #2

1540214384
Report to moderator
eddlow
Newbie
*
Offline Offline

Activity: 52
Merit: 0


View Profile
May 09, 2014, 07:29:24 AM
 #2

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.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!