S
S
shasoft2019-12-23 19:23:00
Qt
shasoft, 2019-12-23 19:23:00

Quick function for building a HASH of a file?

Need a quick function of building a "cast" of the file. Now I use Sha256+MD5. But is there something faster?
ps needed to compare file identity

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
towin, 2019-12-23
@shasoft

Do you need a cryptographic hash function or a simple one?
If you do not need to protect yourself from the fact that an attacker will forge a file so that the hash matches, then it is enough to calculate CRC32.

D
Dmitry Shitskov, 2019-12-23
@Zarom

Faster only md5 or sha1

M
mayton2019, 2019-12-25
@mayton2019

In general, you can take SHA1 for modern hardware and use it safely. If the libraries are updated to normal versions, then new processor instructions specially created for this function will be used.
For a benchmark, you can run openssl speed. There will be a report on all hashing algorithms for your hardware.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question