Here you can find the source of SHA1(String text)
public static byte[] SHA1(String text) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] SHA1(String text) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(text.getBytes());/*from w ww. jav a 2 s. c om*/ return md.digest(); } }