Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { private static byte[] generateDigest(String algorithm, String... params) throws NoSuchAlgorithmException { StringBuilder sb = new StringBuilder(512); for (String s : params) { sb.append(s); } return MessageDigest.getInstance(algorithm).digest(sb.toString().getBytes()); } }