What is hash function ?!
Hash function maps a variable length message into a fixed length hash value.
Cryptographic hash function is an algorithm for which no attack is more efficient than brute force to find
1- Get the message from the hash value.
2- Find two messages with the same hash value.
Building a simple hash function The simplest form of hash function is bit-by-bit XOR but it is not secure at all h = B1 ⊕ B2 ⊕ B3 ….

Secure Hashing Algorithm (SHA) is based on the hash function MD4 ,SHA was developed by National Institute of Standards and Technology (NIST) and published in 1993 known as SHA-0, and then published SHA-1 in 1995 that produces a hash value of 160 bits, Then SHA-2 with a hash value length of 256,384 and 512 bits known as SHA-256 SHA-384 and SHA-512 respectively.
SHA-512 SHA-512 takes as input a message with a maximum length less than \(2^{128}\) and produces 512 bits.