curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Curl feature idea, download hash checking

From: Ian Norton via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 12 Jun 2026 08:49:42 +0000

Hi there curl people :)

I have been contemplating contributing a feature to the command-line tool and wanted to see what people thought of it first.

My use case is that I want to download a file and save it to disk and at the same time verify that the file is what I expected (ie, to catch replaced files, truncated http transfers and other network issues).

Right now the way I’d do this is to do curl -O URL​ (or —-output FILE) and then use something like sha256sum -c​ to check the expected digest(s). Rather than having this as a two step, multi-tool thing would it be welcome for curl to do this all-in-one?

Eg,

curl -O URL —-hash sha256:HASH_VALUE​

Where curl would exit with status 0 if the digest of the downloaded file matched the —-hash argument, else exit non-zero.

Does this sound like a good idea?

Ian

Sent from Outlook for Mac
Any email and files/attachments transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. If this message has been sent to you in error, you must not copy, distribute or disclose of the information it contains. Please notify Entrust immediately and delete the message from your system.


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2026-06-12