Here you can find the source of SHA1(final String text)
public static byte[] SHA1(final String text) throws Exception
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; public class Main { public static byte[] SHA1(final String text) throws Exception { final MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(text.getBytes("iso-8859-1"), 0, text.length()); final byte[] sha1hash = md.digest(); return sha1hash; }//from w ww . j a v a2s.c o m }