Here you can find the source of digestSHA1(String login, String pass)
public static String digestSHA1(String login, String pass) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { private static final String hexDigits = "0123456789abcdef"; public static String digestSHA1(String login, String pass) throws NoSuchAlgorithmException { String input = login + pass; return byteArrayToHexString(digest(input.getBytes(), "SHA-1")); }//from www .j a v a 2s . com public static String byteArrayToHexString(byte[] b) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < b.length; i++) { int j = ((int) b[i]) & 0xFF; buf.append(hexDigits.charAt(j / 16)); buf.append(hexDigits.charAt(j % 16)); } return buf.toString(); } public static byte[] digest(byte[] input, String algoritmo) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance(algoritmo); md.reset(); return md.digest(input); } }