From 73b5c8512d2740effa84c9e476b05c7bce1b0578 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 6 Jun 2021 18:00:14 +0200 Subject: [PATCH] sys: Added default polynomial and inital value for CRC16 and CRC32 --- source/views/view_hashes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/views/view_hashes.cpp b/source/views/view_hashes.cpp index 8df78c06c..eb9d2282e 100644 --- a/source/views/view_hashes.cpp +++ b/source/views/view_hashes.cpp @@ -72,7 +72,7 @@ namespace hex { switch (this->m_currHashFunction) { case 0: // CRC16 { - static int polynomial = 0, init = 0; + static int polynomial = 0x8005, init = 0x0000; ImGui::InputInt("hex.view.hashes.iv"_lang, &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal); if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true; @@ -97,7 +97,7 @@ namespace hex { break; case 1: // CRC32 { - static int polynomial = 0, init = 0; + static int polynomial = 0x04C11DB7, init = 0xFFFFFFFF; ImGui::InputInt("hex.view.hashes.iv"_lang, &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal); if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;