MCPcopy Create free account
hub / github.com/ElementsProject/elements / hex_switchEndian

Function hex_switchEndian

contrib/linearize/linearize-hashes.py:20–23  ·  view source on GitHub ↗

Switches the endianness of a hex string (in pairs of hex chars)

(s)

Source from the content-addressed store, hash-verified

18settings = {}
19
20def hex_switchEndian(s):
21 """ Switches the endianness of a hex string (in pairs of hex chars) """
22 pairList = [s[i:i+2].encode() for i in range(0, len(s), 2)]
23 return b''.join(pairList[::-1]).decode()
24
25class BitcoinRPC:
26 def __init__(self, host, port, username, password):

Callers 1

get_block_hashesFunction · 0.70

Calls 3

encodeMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected