Here you can find the source of sha1(String input)
public static byte[] sha1(String input)
//package com.java2s; //License from project: Open Source License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] sha1(String input) { try {/*from w ww . j a v a2 s.c o m*/ MessageDigest mDigest = MessageDigest.getInstance("SHA1"); return mDigest.digest(input.getBytes()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } }