nur-dev's picture
Publish reproducibility artifacts (part 2)
fe31b61 verified
Raw History Blame Contribute Delete
448 Bytes
"""Exact helper functions extracted from the frozen source adapter."""
import hashlib
def digest_int(text):return int(hashlib.sha256(text.encode()).hexdigest(),16)
def member(z,suffix):
names=[n for n in z.namelist() if n.rsplit('/',1)[-1].lower()==suffix.lower()]
assert names,(suffix,z.namelist())
# Provider robot archive contains both raw and nested zip copies; use raw.
return z.read(sorted(names,key=lambda n:(len(n),n))[0])