speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
292 stars 36 forks source link

other SHA functions #414

Closed pr-apes closed 1 year ago

pr-apes commented 2 years ago

@pgundlach,

would it be possible that we have sd:sha512() and sd:sha512-file()?

https://github.com/Egor-Skriptunoff/pure_lua_SHA seems to have a much optimized code for all SHA functions in Lua.

As for abandoning SHA1, it seems not to be very safe (https://en.wikipedia.org/wiki/SHA-1#Attacks).

As for hashing files, it is also an extremely useful function.

I already use this feature (in ConTeXt) for external files (either embedded in the PDF document or not).

Many thanks for your help.

pgundlach commented 2 years ago

Good point, thank you. Will be in the next version (sd:sha1(),sd:sha256(), sd:sha512() and sd:md5() for calculation and doc() for reading file contents to get sd:sha512-file() (sd:sha512(doc(...))).

pr-apes commented 2 years ago

Many thanks for the new functionality.

pr-apes commented 1 year ago

@pgundlach,

I think I could provide these [or at least, I would like to try].

So, if you haven't started to work on this, let me know and I would try to submit a PR.

That way, attaching files other than ZUGFeRD could be solved first.

pgundlach commented 1 year ago

I think I could provide these [or at least, I would like to try].

they are already in the code base...