diff options
author | Daniel Vassdal <shutter@canternet.org> | 2014-07-02 20:55:33 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-08-04 12:38:12 +0200 |
commit | 5c7db14a557d7f980dfaa8c10d40c1ccc554b35d (patch) | |
tree | d9d0b3161928f1ba9cbf0ced5f894c2d1c6a1886 /src/modules/m_sha256.cpp | |
parent | 0c0a7b6404c5de51241cdaa3eb159d014ef51024 (diff) |
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
Diffstat (limited to 'src/modules/m_sha256.cpp')
-rw-r--r-- | src/modules/m_sha256.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 |