Here you can find the source of digest(String message, byte[] salt)
Parameter | Description |
---|---|
message | the message to calculate a digest for |
salt | the salt to use. |
public static synchronized byte[] digest(String message, byte[] salt)
//package com.java2s; import java.security.MessageDigest; public class Main { private static MessageDigest md; /**//from w w w . j ava 2s . c o m * Create a digest from salt and a message. * * @param message * the message to calculate a digest for * @param salt * the salt to use. * @return the resulting digest, will be 20 bytes long. */ public static synchronized byte[] digest(String message, byte[] salt) { try { byte[] msg = message.getBytes("UTF-8"); md.update(salt); md.update(msg); } catch (Exception ex) { } return md.digest(); } }