Hook

—
Their other posts in the index, biggest breakout first.
How would you check that two files are the same as each other using code? This is a common problem if you're building a file upload service like Dropbox or even if you're building an application that needs to work with files and you want to avoid duplicates. The naive way would be to read both files byte by byte. The problem with that is it's pretty slow and it doesn't scale very well, especially if you're working with larger files. A better way is to use what's known as a hashing function. The idea is that this hashing function takes your file and produces a digital fingerprint. This fingerprint is like a signature, it's much smaller. And what you can do is you can compare both fingerprints to each other. If they're the same, you've got a match. And this works decently sized files. Now for your use case, a hashing function and fingerprint comparison will work pretty well. But if you're building something like Dropbox, you want to opt for what's known as chunking. I'll cover that in another video, so make sure you give me a follow.