Topic: Question about hashes in QElectroTech

An die Haupt-Entwickler:

Salut Joshua !
Salut Laurent !

English follows below!

Brauchen wir bei QET zufällige Hashes, die irgendwas verschlüsseln, oder so? Die einzigen zufälligen Zahlen, die ich sehe, sind die UUIDs in den Elementen. Aber vielleicht übersehe ich auch etwas...

Grund der Frage:
Die XML-Tags in den Element- und Projekt-Dateien werden bei jedem Abspeichern durcheinandergewürfelt, da die Informationen dazu in Hashes gespeichert werden, deren zugrundeliegende Zufallszahl regelmäßig erneuert wird.
Wenn wir auf die zufällige Sortierung in den Hashes verzichten können, können wir dafür beim Start von QET einen Vorgabewert an Qt geben, sodass die Sortierung der XML-Tags von einem Speichervorgang zum nächsten nicht komplett durcheinandergewürfelt werden!
Bei Projektdateien wird das XML regelmäßig aus der internen SQlite-DB neu erzeugt, und daher sind die Tags nicht immer in derselben Reihenfolge.
Bei Element-Dateien scheint es aber sehr gut zu funktionieren, dass die Tags nicht gemischt werden, wenn die Randomisierung abgeschaltet ist! Auf diese Art werden DIFFs von Element-Dateien nicht so groß, wenn nur eine Kleinigkeit daran geändert wird, wie z.B. das Hinzufügen einer weiteren Sprache.

Einen Patch habe ich in meinem github-repository vorbereitet.

Gruß
  plc-user


English translation:

To the main-developers:

Do we need random hashes with QET that encrypt something or something like that? The only random numbers I see are the UUIDs in the elements. But maybe I'm overlooking something...

Reason for the question:
The XML tags in the element and project files are mixed up every time they are saved, because the information is stored in hashes whose underlying random number is regularly renewed.
If we can do without the random sorting in the hashes, we can give Qt a default value when starting QET so that the sorting of the XML tags is not completely mixed up from one save operation to the next!
For project files, the XML is regularly regenerated from the internal SQlite DB, so the tags are not always in the same order.
However, for element files, it seems to work very well that the tags are not mixed when randomization is turned off! This way, DIFFs of element files do not become so large when only a small change is made, such as adding another language.

I prepared a patch in my github-repository.

Best regards,
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Question about hashes in QElectroTech

French
Non il n'y a aucune raison d'avoir l'ordre des tags de façon aléatoire. D'ailleurs c'est pour cela qu'on utilise les uuid, il a longtemps les tags des xml était toujours dans les même ordre puis cela à changer par la suite (Qt4 -> Qt5 ? je ne me rappelle plus ?)
Par contre je ne savais pas que l'on pouvais rendre fixe cela, je veut bien voir ton patch. Quoi qu'il en soit on continuera à utiliser les uuid, mais les diff git seront plus digeste.
Bref si pas de régression c'est ok pour moi.

deutsche Übersetzung

Nein, es gibt keinen Grund, die Reihenfolge der Tags zufällig zu gestalten. Aus diesem Grund verwenden wir übrigens UUIDs. Lange Zeit waren die Tags in den XML-Dateien immer in derselben Reihenfolge, dann hat sich das geändert (Qt4 -> Qt5? Ich weiß es nicht mehr genau).
Ich wusste allerdings nicht, dass man das festlegen kann, ich würde mir deinen Patch gerne ansehen. Wie auch immer, wir werden weiterhin UUIDs verwenden, aber die Git-Differenzen werden übersichtlicher sein.
Kurz gesagt, wenn es keine Regression gibt, ist es für mich in Ordnung.

Übersetzt mit DeepL.com (kostenlose Version)

Développeur QElectroTech

Re: Question about hashes in QElectroTech

https://stackoverflow.com/questions/273 … der-in-xml
https://doc.qt.io/archives/qt-5.15/qhas … ty-attacks

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Question about hashes in QElectroTech

It seems that we do not need qt-version-check to disable randomisation:
Adjusted patch: https://github.com/qelectrotech/qelectr … /pull/415/

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Question about hashes in QElectroTech

Hallo plc-user
salut Joshua,

I ran a few tests on my end without finding any bugs, problems, or slowdowns on big projects.
So I merged it, thanks you plc-user. nomicons/wink

However, I used Kate editor, which allows you to see the diff on the fly of an .elmt element or a .qet project file when modifying QET files, and it's clear that we have the same functionality as we did before on Qt 4.x.

It will once again be useful for our experienced users to version their QET projects  tracked by Git repository at work or at home, in order to quickly see the changes...

I am considering adding a local git repository to my work laptop so that I can closely and carefully monitor the progress of my QET documentation diagram projects.

It is a problem when you track changes of output XML files

Use an XML tool like http://prettydiff.com/ and it will not show differences just because the order of the attributes changes

https://download.qelectrotech.org/qet/forum_img_2/no_random_hashes2.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Question about hashes in QElectroTech

https://github.com/qgis/QGIS/issues/291 … 1906221383

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Question about hashes in QElectroTech

We will wait a little while to see if there are any comments from users, if there are any regressions or if new problems have arisen after this change to the attributes in the XML, which, I would remind you, we changed from random XML attributes to order XML attributes, before marking version 0.100 as stable!

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !