diff options
| author | Martin Ridgers <[email protected]> | 2021-12-15 13:41:45 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-16 09:35:51 +0100 |
| commit | a6101a0cfea738cb623a77aa383548e00303907f (patch) | |
| tree | 13f4b5ee4f7d30a34704a53f6d3da5663417d3e6 | |
| parent | Compile out source_location use if the toolchain doesn't support it (diff) | |
| download | zen-a6101a0cfea738cb623a77aa383548e00303907f.tar.xz zen-a6101a0cfea738cb623a77aa383548e00303907f.zip | |
Copy/paste errors in MD5 from SHA1
| -rw-r--r-- | zencore/include/zencore/md5.h | 6 | ||||
| -rw-r--r-- | zencore/md5.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/zencore/include/zencore/md5.h b/zencore/include/zencore/md5.h index 4ed4f6c56..d934dd86b 100644 --- a/zencore/include/zencore/md5.h +++ b/zencore/include/zencore/md5.h @@ -16,19 +16,19 @@ struct MD5 inline auto operator<=>(const MD5& rhs) const = default; - static const int StringLength = 40; + static const int StringLength = 32; typedef char String_t[StringLength + 1]; static MD5 HashMemory(const void* data, size_t byteCount); static MD5 FromHexString(const char* string); - const char* ToHexString(char* outString /* 40 characters + NUL terminator */) const; + const char* ToHexString(char* outString /* 32 characters + NUL terminator */) const; StringBuilderBase& ToHexString(StringBuilderBase& outBuilder) const; static MD5 Zero; // Initialized to all zeroes }; /** - * Utility class for computing SHA1 hashes + * Utility class for computing MD5 hashes */ class MD5Stream { diff --git a/zencore/md5.cpp b/zencore/md5.cpp index 237f6cfdd..519e41f37 100644 --- a/zencore/md5.cpp +++ b/zencore/md5.cpp @@ -401,7 +401,7 @@ MD5::FromHexString(const char* string) } const char* -MD5::ToHexString(char* outString /* 40 characters + NUL terminator */) const +MD5::ToHexString(char* outString /* 32 characters + NUL terminator */) const { ToHexBytes(Hash, sizeof(MD5), outString); outString[2 * sizeof(MD5)] = '\0'; |