Skip to content

Commit 4a05768

Browse files
committed
Merge pull request #85
1e62df8 bytes (pstratem) bfd29da uint256_to_str (pstratem)
2 parents 08ed5b2 + 1e62df8 commit 4a05768

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

bitcoin/core/serialize.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,12 @@ def compact_from_uint256(v):
336336

337337
return compact | nbytes << 24
338338

339+
def uint256_to_str(u):
340+
r = b""
341+
for i in range(8):
342+
r += struct.pack('<I', u >> (i * 32) & 0xffff)
343+
return r
344+
339345
def uint256_to_shortstr(u):
340346
s = "%064x" % (u,)
341347
return s[:16]

0 commit comments

Comments
 (0)