Atelier des rouesLab FR
Objects/Documentation

comparaison30.py

Shared conditionals and checks · comparaison30.py

Download ↓
"""Compare proof precision and canonical compact JSON bytes on the same historical laws."""
from pathlib import Path
import json
from decouverte30 import study
from contacts27 import TRIPLE

def size(obj):
    return len(json.dumps(obj,default=str,sort_keys=True,separators=(',',':')).encode('utf8'))

def compare():
    old=json.loads(Path(__file__).with_name('precision29.json').read_bytes())
    current=study([('AC',[TRIPLE[0],TRIPLE[2]]),('ABC',TRIPLE)])
    out=[]
    for a,b in zip(old,current['certificates']):
        assert a['name']==b['name'] and a['coeff']==list(b['coeff'])
        out.append(dict(name=a['name'],before=a['bits'],after=b['bits'],old_bytes=size(a['endpoints']),new_bytes=size(b['endpoints'])))

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.