Java Generate SHA-1 using DigestUtils in Apache Commons Codec In below code example you will learn how to use org.apache.commons.codec.digest.DigestUtils class in Apache Commons Codec to generate SHA-1 string in Java.