Question Suggestion : Use sha1 Instead of md5

Status
Not open for further replies.

semprot

Customer
Hello.

I suggest you to use sha1 instead of md5 to generate unique id for cache name,
because sha1 result is longer than md5 result (40 vs 32 characters).
8 more characters = more permutations available = less collision chance. :)
Think about site with tons of pages.
More cache name permutations. :D

Thank you
 
So, an MD5 hash is a 32 character string where each character is a hexadecimal number (0-9 + A-F), meaning you have 1632 possible combinations. 1632 = 3.402823669 x 1038, or roughly 3 with 38 zeroes afterwards.

340,282,366,900,000,000,000,000,000,000,000,000,000 is a very large number, I sure don't know how to pronounce that number :p

With the new change to the Filecache system that separates each cache prefix into its own subfolder, that means that each individual feature, such as Data Registry, can support up to that many data registry entries before collisions occur.

But let's take it a step further. Let's say on average, each of those files is 1 KB in size. We now have the following number: 3.484491437 x 1041 - this number is the amount of bytes needed to store all this information on your server. The largest unit of storage known to man at the moment, according to Wikipedia, is a Yottabyte, or 1.20892582 x 1024.

A yottabyte, from my understanding, is a terabyte terabytes. If that understanding is correct, you would need a yottabyte yottabytes of HD space in order to store enough information to support all the possible combinations an MD5 hash can generate for a 1 KB file.

In short, I'm going to say that the speed of MD5 makes it a more suitable hashing algorithm for this purpose :)


(This post was done a bit tongue-in-cheek since hash collisions can occur, but since this is not being used as a cryptographic measure where the user can manipulate the hash to try to bypass a cryptographic system, the chances of hash collision is very, very low)
 
I think you are correct. I think before collision happens, my disk will be full first / my RAM usage will be 100% first :D
 
Hello semprot,

This ticket has now been closed with the status Answered.

We hope your issue or question has been addressed to your satisfaction. If not, please feel free to re-open it by clicking this link.

If you have any further issues or questions, please feel free to start a new support ticket via the button at the top of every page.

Thank you!
 
Status
Not open for further replies.

Legacy DragonByte Optimise

XenForo 1.5.3+
Seller
DragonByte Technologies
Release date
Last update
Total downloads
258
Customer rating
0.00 star(s) 0 ratings
Back
Top