コード例 #1
0
ファイル: tx.py プロジェクト: etherume/mmgen
def wiftoaddr(s):
	if s == "": return False
	compressed = not s[0] == '5'
	from mmgen.bitcoin import wiftohex,privnum2addr
	hex_key = wiftohex(s,compressed)
	if not hex_key: return False
	return privnum2addr(int(hex_key,16),compressed)
コード例 #2
0
ファイル: tool.py プロジェクト: etherume/mmgen
def wif2hex(wif,compressed=False):
	Msg(bitcoin.wiftohex(wif,compressed))
コード例 #3
0
ファイル: tool.py プロジェクト: etherume/mmgen
def wif2addr(wif,compressed=False):
	s_enc = bitcoin.wiftohex(wif,compressed)
	if s_enc == False:
		die(1,"Invalid address")
	addr = bitcoin.privnum2addr(int(s_enc,16),compressed)
	Vmsg_r("Addr: "); Msg(addr)
コード例 #4
0
ファイル: tool.py プロジェクト: etherume/mmgen
def randwif(compressed=False):
	r_hex = ba.hexlify(get_random(32))
	enc = bitcoin.hextowif(r_hex,compressed)
	dec = bitcoin.wiftohex(enc,compressed)
	print_convert_results(r_hex,enc,dec,"hex")
コード例 #5
0
ファイル: tx.py プロジェクト: etherume/mmgen
def is_wif(s):
	if s == "": return False
	compressed = not s[0] == '5'
	from mmgen.bitcoin import wiftohex
	return wiftohex(s,compressed) is not False