animetosho / ParPar

High performance PAR2 create client for NodeJS
190 stars 19 forks source link

[Request] Make the program check itself. #38

Closed uxmy closed 1 year ago

uxmy commented 2 years ago

I wish you can add an auto checksum verification to the program (similar to the one implemented in par2j ), to make sure the executable is not damaged by bit rot for example.

animetosho commented 2 years ago

Thanks for the suggestion!

This is an interesting idea, probably a bit tricky to implement though (has to be tied to a build). There's also the question of dependencies, which can't be verified by ParPar, but I suppose there may be other ways to do it.

I can't see it implemented in par2j though? Just tried modifying a byte in the executable, and it runs without complaint. Or are you referring to some other check perhaps?

uxmy commented 2 years ago

Here is a screenshot https://i.imgur.com/6VpGKLa.png Thanks for the fast reply and your fast program as well.

animetosho commented 2 years ago

Ah I see, missed that - thanks for pointing that out!

It looks like there's some post-build step (alter executable's CRC) that the author performs before release, because building par2j from source causes that error.

I can look at adding a check for built executables, but don't think there's a nice way to do it for NPM based installs.