Here you can find the source of digest(String source)
public static byte[] digest(String source) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.*; public class Main { public static byte[] digest(String source) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA1"); md.update(source.getBytes());/*from w w w . j a v a2s. com*/ return md.digest(); } }