sys: Added default polynomial and inital value for CRC16 and CRC32

This commit is contained in:
WerWolv 2021-06-06 18:00:14 +02:00
parent b1adfe38e1
commit 73b5c8512d
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ namespace hex {
switch (this->m_currHashFunction) { switch (this->m_currHashFunction) {
case 0: // CRC16 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); ImGui::InputInt("hex.view.hashes.iv"_lang, &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal);
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true; if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;
@ -97,7 +97,7 @@ namespace hex {
break; break;
case 1: // CRC32 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); ImGui::InputInt("hex.view.hashes.iv"_lang, &init, 0, 0, ImGuiInputTextFlags_CharsHexadecimal);
if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true; if (ImGui::IsItemEdited()) this->m_shouldInvalidate = true;