How many random elements before MD5 produces collisions?

前端 未结 8 1801
执笔经年
执笔经年 2020-11-22 12:25

I\'ve got an image library on Amazon S3. For each image, I md5 the source URL on my server plus a timestamp to get a unique filename. Since S3 can\'t have subdirectories, I

8条回答
  •  长情又很酷
    2020-11-22 12:33

    So wait, is it:

    md5(filename) + timestamp
    

    or:

    md5(filename + timestamp)
    

    If the former, you are most of the way to a GUID, and I wouldn't worry about it. If the latter, then see Karg's post about how you will run into collisions eventually.

提交回复
热议问题