Be careful, the code below is codepage dependent. TStrings.GetTextStr does not inspect the codepage of each string and simply moves the characters into a common buffer. Fast, but the question is: are you using the hash to compare two string lists that are binary equivalent or two string lists that contain the same unicode characters. The code below only guarantees to answer the first question.

On 04/07/2019 23:58, Bo Berglund wrote:
On Thu, 4 Jul 2019 18:13:44 +0200, José Mejuto
<joshy...@gmail.com> wrote:

El 04/07/2019 a las 18:13, James Richters escribió:
Thanks you!

That got me on the right path.
Here's the working sample:

Hash  := Md5Print(MD5String(MyStringlist.Text));

Warning! That's platform dependent code due the new line sequences.
Maybe:

MyStringList.LineBreak := #10;
Hash  := Md5Print(MD5String(MyStringlist.Text));

Then the new line issue may be solved?


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to