Objets/Documentation
flux18.py
Amortir un histogramme · Programme Python reproductible.
Télécharger ↓"""Byte-level fixed-weight binary block stream with one histogram per group."""
import json
from math import comb
def unrank(n,k,r):
word=0
for j in reversed(range(n)):
first=comb(j,k) if k<=j else 0
if r>=first:
word|=1<<j
r-=first
k-=1
return word