Java SHA1 sha1(byte[] bytes)

Here you can find the source of sha1(byte[] bytes)

Description

returns a 20 byte sha1 hash

License

Open Source License

Parameter

Parameter Description
bytes a parameter

Declaration

@Deprecated
public static byte[] sha1(byte[] bytes) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.security.MessageDigest;

public class Main {
    /**//  ww  w .j a v  a  2 s .  co  m
     * returns a 20 byte sha1 hash 
     * @param bytes
     * @return
     * @deprecated moved to HashFunctions
     */
    @Deprecated
    public static byte[] sha1(byte[] bytes) {
        try {
            MessageDigest sha = MessageDigest.getInstance("SHA-1");
            byte[] result = sha.digest(bytes);
            return result;
        } catch (Exception x) {

        }
        return null;
    }
}

Related

  1. generateSHA1(String message)
  2. generateSHA1ChecksumFile(String filename)
  3. generateSHA1Key(String input)
  4. generateSHA1RSASignature(RSAPrivateKey privKey, byte[] text)
  5. generateSHA1String(String stringToEncode)
  6. sha1(byte[] bytes)
  7. sha1(byte[] bytes)
  8. SHA1(byte[] bytes)
  9. SHA1(byte[] convertme)