diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa52d0..4efd33d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Version History =============== +V2.8.4 +------ +The "Expected Hash Value" field had been broke a little in the 2.8.3 release meaning that when the user first pasted a value, it would report a mis-match even when it matched. But if the user re-pasted the value, it would match as intended (https://quickhash-gui.org/bugs/expected-hash-value-report-wrongly-on-single-file-hashing/). That fault was fixed. +The "Expected Hash Value" was comparing only 7 characters instead of 8 for xxHash. That was fixed. +The date and time formatting that was reported as fixed in v2.8.3 was not as fixed as it should be, and also was not included in the Linux version as it should have been. +The "Text" field had been accidentally adjusted to use pointers to widestrings. The commit was accepted without realisng the impact. So 'hello' was not being hashed but it's Unicode widestring version was being hashed. That was fixed and reverted to it's previous settings. + v2.8.3 ------ diff --git a/diskmodule.lfm b/diskmodule.lfm index 7d4c5f7..290181c 100644 --- a/diskmodule.lfm +++ b/diskmodule.lfm @@ -3,7 +3,7 @@ object frmDiskHashingModule: TfrmDiskHashingModule Height = 623 Top = 363 Width = 787 - Caption = 'QuickHash v2.8.3 - Disk Hashing Module' + Caption = 'QuickHash v2.8.4 - Disk Hashing Module' ClientHeight = 623 ClientWidth = 787 DefaultMonitor = dmDesktop diff --git a/project1.lpr b/project1.lpr index 970ec7e..6a6b013 100644 --- a/project1.lpr +++ b/project1.lpr @@ -15,7 +15,7 @@ {$R *.res} begin - Application.Title:='QuickHash'; + Application.Title:='Quick Hash'; Application.Initialize; Application.CreateForm(TMainForm, MainForm); Application.CreateForm(TfrmDisplayGrid1, frmDisplayGrid1); diff --git a/unit2.lfm b/unit2.lfm index 1ccc99d..73ef0a2 100644 --- a/unit2.lfm +++ b/unit2.lfm @@ -4,7 +4,7 @@ object MainForm: TMainForm Top = 73 Width = 1018 AllowDropFiles = True - Caption = 'QuickHash v2.8.3 - The easy and convenient way to hash data in Linux, OSX and Windows' + Caption = 'QuickHash v2.8.4 - The easy and convenient way to hash data in Linux, OSX and Windows' ClientHeight = 695 ClientWidth = 1018 Menu = MainMenu1 @@ -18,11 +18,11 @@ object MainForm: TMainForm Height = 657 Top = 24 Width = 986 - ActivePage = TabSheet4 + ActivePage = TabSheet1 Anchors = [akTop, akLeft, akRight, akBottom] ParentShowHint = False ShowHint = True - TabIndex = 3 + TabIndex = 0 TabOrder = 0 OnChange = PageControl1Change object TabSheet1: TTabSheet @@ -314,6 +314,7 @@ object MainForm: TMainForm 'Computed hash will appear here...' ) TabOrder = 3 + WordWrap = False end object lbleExpectedHash: TLabeledEdit Left = 6 diff --git a/unit2.pas b/unit2.pas index 32e8957..c004e1a 100644 --- a/unit2.pas +++ b/unit2.pas @@ -874,7 +874,7 @@ procedure TMainForm.HashText(Sender: TObject); end else begin - strHashValueText := Trim(Uppercase(CalcTheHashString(memoHashText.Text))); + strHashValueText := Uppercase(Trim(CalcTheHashString(memoHashText.Text))); StrHashValue.Caption := strHashValueText; if (lbleExpectedHash.Text = '') then exit else @@ -953,23 +953,13 @@ procedure TMainForm.btnHashFileClick(Sender: TObject); stop := Now; elapsed := stop - start; - lbEndedFileAt.Caption := 'Ended at : '+ DateTimeToStr(stop); - lblFileTimeTaken.Caption := 'Time taken : '+ TimeToStr(elapsed); + lbEndedFileAt.Caption := 'Ended at : ' + FormatDateTime('DD/MM/YYYY HH:MM:SS', stop); + lblFileTimeTaken.Caption := 'Time taken : ' + FormatDateTime('HH:MM:SS', elapsed); Application.ProcessMessages; - // If the user has ane existing hash to check, compare it here - if (lbleExpectedHash.Text = '') then exit - else - if (lbleExpectedHash.Text = '...') then exit - else - if fileHashValue = Trim(Uppercase(lbleExpectedHashText.Text)) then - begin - Showmessage('Expected hash matches the generated text hash, OK'); - end - else - begin - Showmessage('Expected hash DOES NOT match the generated text hash!'); - end; + // If the user has ane existing hash to check in expected hash value field, + // compare it here + lbleExpectedHashChange(Sender); end else ShowMessage('An error occured opening the file. Error code: ' + SysErrorMessageUTF8(GetLastOSError)); @@ -1152,7 +1142,7 @@ procedure TMainForm.lbleExpectedHashChange(Sender: TObject); exit else if (Length(trim(lbleExpectedHash.Text)) = 32) or (Length(trim(lbleExpectedHash.Text)) = 40) or (Length(trim(lbleExpectedHash.Text)) = 64) or (Length(trim(lbleExpectedHash.Text)) = 128) - or (Length(trim(lbleExpectedHash.Text)) = 7) then + or (Length(trim(lbleExpectedHash.Text)) = 8) then begin if Uppercase(memFileHashField.Lines[0]) = Trim(Uppercase(lbleExpectedHash.Text)) then begin @@ -3080,10 +3070,8 @@ function TMainForm.ValidateTextWithHash(strToBeHashed:ansistring) : string; function TMainForm.CalcTheHashString(strToBeHashed:ansistring):string; var TabRadioGroup1: TRadioGroup; - _strToBeHashed: UnicodeString; begin TabRadioGroup1 := AlgorithmChoiceRadioBox1; - _strToBeHashed := PWideChar(strToBeHashed); result := ''; if Length(strToBeHashed) > 0 then begin @@ -3097,22 +3085,22 @@ function TMainForm.CalcTheHashString(strToBeHashed:ansistring):string; case TabRadioGroup1.ItemIndex of 0: begin - result := THashFactory.TCrypto.CreateMD5().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.TCrypto.CreateMD5().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); end; 1: begin - result := THashFactory.TCrypto.CreateSHA1().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.TCrypto.CreateSHA1().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); end; 2: begin - result := THashFactory.TCrypto.CreateSHA2_256().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.TCrypto.CreateSHA2_256().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); end; 3: begin - result := THashFactory.TCrypto.CreateSHA2_512().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.TCrypto.CreateSHA2_512().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); end; 4: begin {$ifdef CPU64} - result := THashFactory.THash64.CreateXXHash64().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.THash64.CreateXXHash64().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); {$else if CPU32} - result := THashFactory.THash32.CreateXXHash32().ComputeString(_strToBeHashed, TEncoding.UTF8).ToString(); + result := THashFactory.THash32.CreateXXHash32().ComputeString(strToBeHashed, TEncoding.UTF8).ToString(); {$endif} end; end;