From 0ab40dc1ab4e689921da54080b135e1d22b1c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 14 Mar 2017 21:45:23 +0100 Subject: Refactoring louloulibs and cmake Use OBJECT libraries Remove the louloulibs directory Write FOUND variables in the cache --- louloulibs/utils/sha1.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 louloulibs/utils/sha1.cpp (limited to 'louloulibs/utils/sha1.cpp') diff --git a/louloulibs/utils/sha1.cpp b/louloulibs/utils/sha1.cpp deleted file mode 100644 index 71ad18d..0000000 --- a/louloulibs/utils/sha1.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include - -#include - -#ifdef BOTAN_FOUND -# include -# include -#endif -#ifdef GCRYPT_FOUND -# include -# include -# include -# include -#endif - -std::string sha1(const std::string& input) -{ -#ifdef BOTAN_FOUND - auto sha1 = Botan::HashFunction::create_or_throw("SHA-1"); - sha1->update(input); - return Botan::hex_encode(sha1->final(), false); -#endif -#ifdef GCRYPT_FOUND - const auto hash_length = gcry_md_get_algo_dlen(GCRY_MD_SHA1); - std::vector output(hash_length, {}); - gcry_md_hash_buffer(GCRY_MD_SHA1, output.data(), input.data(), input.size()); - std::ostringstream digest; - for (std::size_t i = 0; i < hash_length; i++) - digest << std::hex << std::setfill('0') << std::setw(2) << static_cast(output[i]); - return digest.str(); -#endif -} -- cgit v1.2.3