Skip to content

Is Modelica.Utilities.Strings.hashString supposed to be tool-independent? #4419

@casella

Description

@casella

The documentation of Modelica.Utilities.Strings.hashString says:

immagine

This is consistent with ModelicaTest.Utilities.TestString:

hash1 := Strings.hashString("this is a test");
assert(hash1 == 1827717433, "Strings.hashString 1 failed");

However, if I compute Modelica.Utilities.Strings.hashString("this is a test") with Dymola 2024x I get 1734720762, not 1827717433. In fact, ModelicaTest.Utilities fails in Dymola 2024x.

Apparently, this issue was discussed in the context of #3415 when looking for MSL 3.2.3->4.0.0 regressions and eventually dismissed as a "tool issue". Looking at PR #3442, the hash test was removed on Feb 24 2020 and re-introduced on Feb 25 2020 in the PR, which was then merged on master on Jan 19 2021.

Do I understand correctly that the intent is that hashString is tool-independent? This has consequences in real life, see OpenModelica/OpenModelica#12569

Metadata

Metadata

Labels

L: UtilitiesIssue addresses Modelica.Utilitiestool-issueIssue targets a specific Modelica tool only

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions