1

I need a non-crypto-secure hash function which produces at least 16 bytes of output.

I'm currently using MD5, but it's too slow, by a factor of around 5 times.

Adler32, CRC32, etc. do not produce the required amount of output.

Is there a way of turning checksums into hash functions, producing the required 16 bytes+ of output?

4
  • More bytes of output don't mean collisions are less likely, the quality of the hash function is at least as important. Why do you want 16 bytes outputs? Would just padding a shorter output (e.g. with zeros) suffice?
    – user395760
    Feb 21, 2013 at 16:40
  • I could pad with some zeros, but a 32bit (best case - one in four billion) chance of collision is too close for comfort. CRC-64 could be a solution, if it really has the collision resistance that its output size map implies.
    – fadedbee
    Feb 21, 2013 at 17:12
  • As I said before, collision resistance is at best only partially related to output size, so don't read too much into it. What do you need those for anyway?
    – user395760
    Feb 21, 2013 at 17:24
  • @delnan hashing sparse terabyte files - a comment on a related question has yielded a great solution: stackoverflow.com/questions/15007629/…
    – fadedbee
    Feb 22, 2013 at 10:24

1 Answer 1

1

I initially used 4 different 32 bit checksums and concatenated their output to make 16 bytes.

I then solved the problem properly: Optimise updating MD5/SHA1 with streams of zeros

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.