Datasets:
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Tags:
mathematics
information-theory
renyi-entropy
shannon-entropy
hidden-markov-models
bernoulli-convolutions
Download verify_manifest.py from PureOne/VELORYN-Boundary-Kernel-Entropy: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/verify_manifest.py
- Command line
-
hf download hf://datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/verify_manifest.py
-
curl -L -o verify_manifest.py https://huggingface.co/datasets/PureOne/VELORYN-Boundary-Kernel-Entropy/resolve/main/verify_manifest.py
1.16 kB
| """Check SHA-256 hashes of the distributed files. This is integrity, not proof checking.""" | |
| from pathlib import Path, PurePosixPath | |
| import hashlib | |
| import sys | |
| root=Path(__file__).resolve().parent | |
| manifest=root/'MANIFEST.sha256' | |
| if not manifest.is_file(): | |
| raise SystemExit('MANIFEST.sha256 is missing.') | |
| errors=[]; checked=0 | |
| for line in manifest.read_text(encoding='utf-8').splitlines(): | |
| if not line.strip(): continue | |
| try: | |
| expected,name=line.split(' ',1) | |
| except ValueError: | |
| errors.append('Malformed manifest line');continue | |
| rel=PurePosixPath(name) | |
| if rel.is_absolute() or '..' in rel.parts or len(expected)!=64: | |
| errors.append(f'Unsafe or malformed entry: {name}');continue | |
| path=root.joinpath(*rel.parts) | |
| if not path.is_file(): | |
| errors.append(f'Missing: {name}');continue | |
| actual=hashlib.sha256(path.read_bytes()).hexdigest() | |
| if actual!=expected: | |
| errors.append(f'Changed: {name}') | |
| checked+=1 | |
| if errors: | |
| print('\n'.join(errors),file=sys.stderr) | |
| raise SystemExit(1) | |
| print(f'Integrity verified for {checked} distributed files. This is not mathematical proof verification.') | |