I use the below Java snippet to generate a hash password using an input and salt. Is there a way I can get that in Linux command line?
public String getPwd(String input, String salt) {
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(salt.getBytes(StandardCharsets.UTF_8));
byte[] pwd= md.digest(input.getBytes(StandardCharsets.UTF_8));
System.out.println(Base64.encodeBase64URLSafeString(pwd));
}