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

Function hex_switchEndian

contrib/linearize/linearize-data.py:23–26  ·  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

21settings = {}
22
23def hex_switchEndian(s):
24 """ Switches the endianness of a hex string (in pairs of hex chars) """
25 pairList = [s[i:i+2].encode() for i in range(0, len(s), 2)]
26 return b''.join(pairList[::-1]).decode()
27
28def uint32(x):
29 return x & 0xffffffff

Callers 1

get_block_hashesFunction · 0.70

Calls 3

encodeMethod · 0.45
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected