The protocol for digital trust
(EN copy coming soon)
English copy is not active yet. Please refer to the French version.
Architecture
L'objet du protocole.
CC-BY 4.0AGPLv3RFC ouvertFondation neutre
python// alethea
def sliding_min_avg_distance(short, longer):
"""Cherche le meilleur alignement de la séquence courte
dans la longue. Tolère les coupes, trims, recompressions."""
if len(short) > len(longer):
short, longer = longer, short
n, m = len(short), len(longer)
best_avg, best_offset = None, 0
for i in range(m - n + 1):
total = sum(short[j] - longer[i + j] for j in range(n))
avg = total / n
if best_avg is None or avg < best_avg:
best_avg, best_offset = avg, i
return float(best_avg), best_offset