Now-a-day, it is necessary to sign a document digitally.
Digital signatures makes it possible to sign the email messages and the other digital documents in such a way that they can't be repudiated by sender later.
One common/general way is to first run the document through a one-way hashing algorithm that is too difficult to invent.
The function (hashing function) produces a fixed-length result independent of the original document size.
MD5 and SHA are the most popular hashing functions.
Here, MD5 stands for Message Digest, and SHA stands for Secure Hash Algorithm.
MD5 produces a 16-byte result and SHA produces a 20-byte result.