Here you can find the source of sha1Hash(String source)
public static String sha1Hash(String source) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Open Source License import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static String sha1Hash(String source) throws NoSuchAlgorithmException { MessageDigest digest = MessageDigest.getInstance("SHA1"); digest.update(source.getBytes(), 0, source.length()); return String.format("%040X", new BigInteger(1, digest.digest())); }//from w w w. j a v a2s. c o m }