Forum > General

Fingerprinting source units

<< < (2/2)

Kays:

--- Quote from: MarkMLl on October 11, 2022, 02:07:04 pm ---[…] I said absolutely nothing about the .ppu, […]
--- End quote ---
Excuse me, did you even read my first post. I stated
--- Quote from: Kays on October 11, 2022, 11:55:30 am ---Every compiled unit has a couple checksums, see
--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ppudump -vh someunit.ppu
--- End quote ---

--- Quote from: MarkMLl on October 11, 2022, 02:07:04 pm ---[…] I said take a hash of the SOURCE FILE and assign that as a constant value, […]
--- End quote ---
I’m sorry, but it doesn’t make sense to me to take the hash of the, quote, SOURCE FILE. The following two source files
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit foobar;interfaceimplementationend.
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---// Great unit!unit foobar;interfaceimplementationend.will have the exactly same checksums as reported by ppudump(1) but, for instance, sha512sum(1) will report different checksums. It sounds unreasonable to me why (a change in) a comment should “sound the alarms”.

MarkMLl:

--- Quote from: Kays on October 11, 2022, 02:54:57 pm ---It sounds unreasonable to me why (a change in) a comment should “sound the alarms”.

--- End quote ---

The file's changed. Of course it gets a different checksum: in exactly the way that a distribution package will get a different checksum if the release note's changed even if the binary's functionality isn't.

And I'm talking about being able to put the checksum into a constant, so that a unit can mark at the time of compilation that it's derived from such-and-such a sourcefile, and that the hash of that sourcefile can be verified by a standard utility.

If you wanted to kvetch a far more significant failing is that the unit checksum wouldn't automatically incorporate that of included files, although I'd counter that that could be handled by usage conventions.

And that's what this suggestion boils down to: an additional expansion which would allow a particular usage convention which at present is not easily attainable.

MarkMLl

Navigation

[0] Message Index

[*] Previous page

Go to full version