Objets/Documentation
residus26.py
Le prix d’un préfixe en octets · residus26.py
Télécharger ↓"""Reach the weight-four byte decision using only a block residue and length bit count."""
from math import ceil
from plages25 import count
from pathlib import Path
import json
def delta(block_residue,length_bits):
pad=(-1-5*block_residue)%8
return (2*length_bits-1-pad+7)//8-(length_bits+6)//7
def study():
old=json.loads(Path(__file__).with_name('plages25.json').read_bytes())[1]
table=[[delta(k,b) for k in range(8)] for b in range(1,18)]
checked=0
for a,b,sgn in old['intervals']:
for n in range(a,b+1):