1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-03-23 16:05:41 +00:00

BIPs 119, 330, 352: code typo and style fixups

Co-authored-by: Tomass <155266802+zeroprooff@users.noreply.github.com>
Co-authored-by: emmmm <155267286+eeemmmmmm@users.noreply.github.com>
This commit is contained in:
sashaodessa
2025-09-03 20:06:10 +02:00
committed by Jon Atack
parent 9297c12729
commit 6340cecfbc
3 changed files with 6 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env python3
import random
######## ENCODING and DECODING ########
FIELD_BITS = 32
@@ -31,8 +33,6 @@ def sketch(shortids, capacity):
######## DECODING only ########
import random
def inv(x):
"""Compute 1/x in GF(2^FIELD_BITS)"""
t = x
@@ -154,4 +154,3 @@ def decode(sketch):
else:
sums.append(odd_sums[(i+1)//2])
return find_roots(list(reversed(berlekamp_massey(sums))))