What if an OS stored a checksum of every file on your computer so your web browser could know if you downloaded a...

What if an OS stored a checksum of every file on your computer so your web browser could know if you downloaded a duplicate

Attached: 1495147543587.png (472x508, 6K)

Other urls found in this thread:

bench.cr.yp.to/primitives-hash.html
twitter.com/SFWRedditGifs

what if you weren't rarted

Why would your OS do this when your Web Browser can easily record checksums of all files in your download locations?

What a fucking awful idea to force the kernel to even do that for a web browser of all things.

Attached: 8nRqoXW.jpg.png (800x729, 48K)

you'd probably save some bandwidth then

what if you have hundreds of thousands if not millions of files and that this is a huge waste of time

Because what if I move files around

what if it would save me organization time

Sounds like you're a disorganized cunt to begin with. Have you considered taking the time to organize your files so you don't have a problem as retarded as repeatedly downloading the same file because you don't know where you put it the last time?

useful for deduplication, some filesystems already store checksums along with files.

What if?
>muh extra 100mb of space taken up for 10tb of files

>download 40 GB game
>spend even more time hashing all the files

>checksum
why not just use the file size in bytes. i'm sure it's unique enough as a primary key

edge cases kind of screw it up. While it's probably reasonably accurate for large files, small files are likely to have lots of collisions. It's also easily exploitable and shouldn't be used for trusting outside sources.

unironically this
no use case for this shit

... I'm guessing you don't know much about log n algorithms and data structures. Protip, it's not hard.

>hashing speed is slower than download speed
bench.cr.yp.to/primitives-hash.html
nigger

If it's so easy then why don't you just fucking do it yourself, submit a patch and call it a day?

>small files are likely to have lots of collisions
right but they're small so who cares. but if you do, run a diff on collision to resolve it

Why is this even a problem to begin with? There are use cases where you want to download the same file. What happens when you mount one or several filesystem over a network or from an external drive? The answer is this is a nonproblem.

What is ZFS deduplication?

You can't because there's absolutely no way to calculate a hash before you download the file.
It'd be nice if it was built into http but it isn't.
As others said, you can use post-download dedup or use file length as an unique id in the cases the server gives you that value (not always).

btrfs has out-of-band deduplication as well

oh it already exists hmmmm

yes, but it's possibly different to how you're thinking
it won't prevent or delete the new file, but just make the new file take up no additional disk space
both files are 'there', they just internally share the same physical space on disk

That's an even better idea than what I was thinking

ZFS has optional deduplication that works similarly* to this but it takes a lot of memory, slows down the FS, and doesn't save much space in the grand scheme of things. A lot of the cloud storage and backup services do dedup behind the scenes because that's the scale where it starts to make sense.