Java tutorial
//package com.java2s; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main { public static byte[] calculateSHA1(byte[] data) { try { MessageDigest md = MessageDigest.getInstance("SHA1"); return md.digest(data); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; } }