The getDigestLength() method of MessageDigest class is used to get the size of object of message digest object in bytes.
public final int getDigestLength()
Return Value: This method provides the length of the message digest in byte form.
Below are the examples to illustrate the getDigestLength() method:
Message digest length : 32
Message digest length : 16
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.