Skip to main content
Mirage can answer checksum commands using a hash your storage service already keeps, or by hashing the file on a remote server.

Example: get a file’s hash

With Google Drive mounted at /drive/:
Mirage uses the file’s stored MD5 when available. Otherwise, it reads the file and computes the hash. Verification commands such as md5sum -c checksums.md5 read the files to check their actual contents.

Connect your own backend

Override checksum(path, algorithm) on your VFS. Return the file’s hash as lowercase hexadecimal text, matching exactly the bytes a normal read returns. The method name is the same in Python and TypeScript. Verification with -c reads the files instead. Return None in Python or null in TypeScript when the hash is unavailable, and Mirage computes it from the file.