I asked this question a long time ago.
The answer is to always use the algorithm that was developed for this and pass the time test.
Currently, this algorithm will be bcrypt (there are 2 more, but I do not remember their names). There are bcrypt implementations in each language, so just find one and use it. If computers continue to grow (which will weaken your hashes), you can increase the number of rounds used to slow down (scaled with hardware).
md5, sha1, sha512, etc .: they suck passwords. How much do they suck? You can use mid-length helmets in hours or even seconds with your laptop. And this is normal; they are not designed to protect passwords. They can still be used as cryptographic primitives, for example: you can implement bcrypt using md5.
Happydeveloper
source share