A message digest hash function is a cryptographic primitive used for digital signatures and password protection. It maps a message of arbitrary length to a fixed-length hash value or "message digest". A cryptographic hash should be one-way and collision-resistant. "One-way" means that, given an n-bit hash value, it should require work equivalent to about 2^n hash computations to find any message that hashes to that value. "Collision-resistant" means that finding any two messages which hash to the same value should require work equivalent to about 2^n/2 hash computations. In other words, it should be computationally infeasible to find the original message from the digest or to create another message that produces the same result.
SHA-1 is a 160-bit (20-byte) hash function specified in FIPS PUB 180-2 Secure Hash Standard [FIPS180].
SHA-256 is the newer standard intended as a companion for the new Advanced Encryption Standard (AES) to provide a similar level of enhanced security. SHA-256 is a 256-bit (32-byte) hash and is meant to provide 128 bits of security against collision attacks. SHA-256 is also specified in FIPS PUB 180-2 [FIPS180].
SHA-384 and SHA-512 provide greater levels of security, but at a greater computing cost. Both use the same algorithm but SHA-384 has a different starting value and a shorter digest value.
MD5 is an older, less-secure but faster hash algorithm still in common use.