MCPcopy
hub / github.com/petertodd/python-bitcoinlib / hexlify_str

Function hexlify_str

bitcoin/rpc.py:65–72  ·  view source on GitHub ↗

Given an arbitrary bytes-like object, returns a string (that would encode as ASCII) containing the hex-representation of the bytes-like object. Always succeeds.

(b)

Source from the content-addressed store, hash-verified

63 return binascii.unhexlify(h.encode('ascii'))
64
65def hexlify_str(b):
66 """
67 Given an arbitrary bytes-like object, returns a string (that would encode
68 as ASCII) containing the hex-representation of the bytes-like object.
69
70 Always succeeds.
71 """
72 return binascii.hexlify(b).decode('ascii')
73
74
75class JSONRPCError(Exception):

Callers 5

fundrawtransactionMethod · 0.85
sendrawtransactionMethod · 0.85
signrawtransactionMethod · 0.85
submitblockMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected