import java.security.MessageDigest;
String encoderSHA512(String planeText){
MessageDigest md = MessageDigest.getInstance(MessageDigestAlgorithms.SHA_512);
md.reset();
md.update(planeText.getBytes(Charsets.UTF_8));
return String.format("%0128x",new BigInteger(1,md.digest()));
}
import org.springframework.security.core.token.Sha512DigestUtils;
String encoderSHA512(String planeText){
return String.format(
"%0128x",
new BigInteger(1,Sha512DigestUtils.sha(planeText))
);
}