0

Basically what I'm looking for is the most efficient (fast & secure) way to check a version or the hash of a file. I currently use MD5, but it takes a while to check the hash of a 800mb file.

Any suggestions?

EDIT: By secure, I mean like the users can not edit it.

I'm not sure if users can edit hashes, but they can edit other files that simply contains the version number and such.

EDIT 2: Why the random down voting? What did I do?

Ghawn
  • 19
  • 2
  • MD5 is the fastest of the built-in hashes http://stackoverflow.com/questions/800685/which-cryptographic-hash-function-should-i-choose You may also want to look at Google's CityHash https://github.com/google/cityhash – Eric J. Oct 10 '15 at 19:45
  • I'll look into CityHash, thank you. – Ghawn Oct 10 '15 at 19:46
  • I ported CityHash to C# myself because I could not find a managed implementation back when I needed it. Looks like there's a public C# port now https://github.com/knuppe/cityhash – Eric J. Oct 10 '15 at 19:55

1 Answers1

0

You could try crc32 - its used to check if data is accidental changed. It's faster than md5, but it is no hashing algorithm (not secure)

lumos0815
  • 3,908
  • 2
  • 25
  • 25