in reply to Re: What's the best way to avoid name collisions when creating files?
in thread What's the best way to avoid name collisions when creating files?

But surely there must be a relatively reliable way to create filenames that are guaranteed unique, right? I suppose it depends how reliable you want it to be. I like the md5sum idea or something similar. For example, could I use the Message-Id? That is guaranteed unique, right? I suppose there are messages out there that screw that one up (in particular, spam).

Also I would have to analyze any computational approach (such as doing the md5sum) to make sure it didn't slow down the process too much. What if I had to save a 10MB message? What's the time required to run an md5sum on that?

  • Comment on Re^2: What's the best way to avoid name collisions when creating files?

Replies are listed 'Best First'.
Re^3: What's the best way to avoid name collisions when creating files?
by adamk (Chaplain) on May 03, 2005 at 15:21 UTC
    One of MD5's nice properties is that it's rediculously fast.

    One benchmark I've seen was something like 90 megabytes per second on a quite modest machine. MD4 is a little faster at around 100 megabytes per second, but most of the more cryptographically secure digests are slower, many MUCH slower.

    So much so that the recommendations are to keep using MD5 for non-sensitive stuff, despite recommendations to start moving away for signatures.