MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / HashFile

Function HashFile

Scripts/CI_FetchRootFS.py:72–84  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

70
71
72def HashFile(file):
73 # 32MB buffer size
74 BUFFER_SIZE = 32 * 1024 * 1024
75
76 x = xxhash.xxh3_64(seed=0)
77 b = bytearray(BUFFER_SIZE)
78 mv = memoryview(b)
79
80 with open(file, 'rb') as f:
81 while n := f.readinto(mv):
82 x.update(mv[:n])
83
84 return int.from_bytes(x.digest(), "big")
85
86def RemoveRootFSFolder(RootFSPath):
87 print("Removing previous rootfs extraction before copying")

Callers 1

CheckFilesystemForFSFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected