From 8882410f35a5976644872917d15acd85a5fe7a5f Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 6 Jul 2019 15:00:05 +0200 Subject: [PATCH] Fixed digest --- src/misc/digest.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/misc/digest.h b/src/misc/digest.h index 4cc41d1..9d1d3f7 100644 --- a/src/misc/digest.h +++ b/src/misc/digest.h @@ -32,20 +32,20 @@ #else #include - #define DECLARE_DIGEST(name, method, digestLength) \ - inline std::string name(const std::string& input) { \ - u_char buffer[digestLength]; \ - method((u_char*) input.data(), input.length(), buffer); \ - return std::string((const char*) buffer, digestLength); \ - } \ - \ - inline std::string name(const char* input, ssize_t length = -1) { \ - if(length == -1) length = strlen(input); \ - return name(std::string(input, length)); \ - } \ - \ + #define DECLARE_DIGEST(name, method, digestLength) \ + inline std::string name(const std::string& input) { \ + u_char buffer[digestLength]; \ + method((u_char*) input.data(), input.length(), buffer); \ + return std::string((const char*) buffer, digestLength); \ + } \ + \ + inline std::string name(const char* input, ssize_t length = -1) { \ + if(length == -1) length = strlen(input); \ + return name(std::string(input, digestLength)); \ + } \ + \ inline void name(const char* input, size_t length, uint8_t(& result)[digestLength]) { \ - method((u_char*) input, length, result); \ + method((u_char*) input, length, digestLength); \ } #endif