I have a function to compute SHA-512 digest.
public Hash hash(byte[] data) {
return new Hash(org.apache.commons.codec.digest.DigestUtils.sha512(data));
}
It gives me the following error
The method sha512(byte[]) is undefined for the type DigestUtils
Moreover, using sha512Hex()
instead of sha512()
gives me the same error. I have tried
import static org.apache.commons.codec.digest.MessageDigestAlgorithms.SHA_512;
But no use. The only options I seem to have are these:
Also, I have tried methods from http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/digest/DigestUtils.html as well, but nothing seems to work.
I am using jdk-11.0.2, and everything else works perfectly fine.