From 5c7db14a557d7f980dfaa8c10d40c1ccc554b35d Mon Sep 17 00:00:00 2001 From: Daniel Vassdal Date: Wed, 2 Jul 2014 20:55:33 +0200 Subject: Hashing: Redo API * Don't assume the printable output of hashes is hex * Add virtual Compare() function, usable for KDFs like BCrypt Some changes and bugfixes are by @attilamolnar, original PR #767 --- src/modules/m_sha256.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_sha256.cpp') diff --git a/src/modules/m_sha256.cpp b/src/modules/m_sha256.cpp index d2755bacc..48bfc0041 100644 --- a/src/modules/m_sha256.cpp +++ b/src/modules/m_sha256.cpp @@ -247,14 +247,14 @@ class HashSHA256 : public HashProvider } public: - std::string sum(const std::string& data) + std::string GenerateRaw(const std::string& data) { unsigned char bytes[SHA256_DIGEST_SIZE]; SHA256(data.data(), bytes, data.length()); return std::string((char*)bytes, SHA256_DIGEST_SIZE); } - HashSHA256(Module* parent) : HashProvider(parent, "hash/sha256", 32, 64) {} + HashSHA256(Module* parent) : HashProvider(parent, "sha256", 32, 64) {} }; class ModuleSHA256 : public Module -- cgit v1.3.1-10-gc9f91