Generate recursive folder maps of local directories to document structure.
When you download a 4GB operating system ISO or a large software distribution, how do you know the file wasn't corrupted in transit or maliciously altered by a hacker intercepting the connection?
You use a cryptographic checksum. A hashing algorithm (like SHA-256) takes an input of any size and produces a fixed-length string of characters. Crucially, if even a single bit in the 4GB file is changed, the resulting hash will be completely different.
To secure a large folder of files, developers generate a Manifest. This is a simple text file listing every file and its exact hash.
They publish this manifest in a secure, authenticated location (like a signed GitHub release). After you download the files, you can run a tool to independently calculate the hashes on your machine and compare them to the manifest. If they match perfectly, you have mathematical proof that the files are intact.
Calculating the SHA-256 hash of a large file requires reading the entire file byte-by-byte. In JavaScript, doing this synchronously would freeze the browser tab entirely.
Modern implementations use the SubtleCrypto.digest() API along with Streams or Web Workers. By processing the file in small chunks (e.g., 5MB at a time) and updating the hash state progressively, the browser can securely hash gigabytes of data without locking the UI thread.
Historically, MD5 was the most common algorithm for file checksums. However, MD5 is cryptographically broken. It is vulnerable to Collision Attacks.
A hacker can mathematically construct two entirely different files (one safe, one malware) that produce the exact same MD5 hash. For this reason, MD5 is now banned for security purposes, and SHA-256 or SHA-512 must be used to guarantee integrity.
Why is MD5 no longer recommended for verifying the security and integrity of downloaded files?