From 2bf8e5a0c61088c820ddd493f92a97c07387e353 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Fri, 28 Sep 2018 14:43:45 +0200 Subject: [PATCH] Remove default hash algorithm from the new hash functions Rationale: SHA1 is outdated, we would need to switch to something like SHA256 nowadays. If the algorithm is given explicitly, we can grep for the identifier. When we do the migration from the libgcrypt-intranator API, it's better to explicitly adapt the call sites. --- src/crypto.hxx | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crypto.hxx b/src/crypto.hxx index 8d1e26e..1e830af 100644 --- a/src/crypto.hxx +++ b/src/crypto.hxx @@ -40,13 +40,13 @@ namespace I2n { enum algorithm { NONE=0, MD5=1, SHA1=2, SHA256=8, SHA384=9, SHA512=10 }; // output: hex encoded hash -string hash_data(string data, algorithm algo=SHA1); +string hash_data(string data, algorithm algo); // output: raw binary hash -string hash_data_raw(string data, algorithm algo=SHA1); +string hash_data_raw(string data, algorithm algo); // hash data in 64kB blocks -string hash_file(string filename, algorithm algo=SHA1); +string hash_file(string filename, algorithm algo); string encode_hex(string data); -- 1.7.1