Here you can find the source of sha1Hash()
static public MessageDigest sha1Hash() throws NoSuchAlgorithmException
//package com.java2s; /*/* w ww . ja v a2 s. c o m*/ * Copyright 2014-2017. * Distributed under the terms of the GPLv3 License. * * Authors: * Clemens Zeidler <czei002@aucklanduni.ac.nz> */ import java.security.*; public class Main { static public MessageDigest sha1Hash() throws NoSuchAlgorithmException { return MessageDigest.getInstance("SHA-1"); } static public byte[] sha1Hash(byte data[]) { try { return hash(data, sha1Hash()); } catch (Exception e) { System.out.println(e.getMessage()); return null; } } static public byte[] hash(byte[] data, MessageDigest messageDigest) { messageDigest.reset(); messageDigest.update(data); return messageDigest.digest(); } }