download
raw
350 Bytes
import struct, sys
path, idx, cnt = sys.argv[1], int(sys.argv[2]), int(sys.argv[3])
with open(path, "r+b") as f:
head = f.read(1 << 24)
for key, val in ((b"split.no", idx - 1), (b"split.count", cnt)):
f.seek(head.index(struct.pack("<Q", len(key)) + key + struct.pack("<I", 2)) + len(key) + 12)
f.write(struct.pack("<H", val))

Xet Storage Details

Size:
350 Bytes
·
Xet hash:
a53659117ee923d9eefbc6827afa3482a982150f334cdfc45a2aec0cb0d1983b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.