Java SHA SHAHash(byte[] input)

Here you can find the source of SHAHash(byte[] input)

Description

Performs an SHA1 hash of an input byte array

License

Open Source License

Declaration

public static byte[] SHAHash(byte[] input) 

Method Source Code

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

import java.security.*;

public class Main {
    /**//ww w .  j  a v  a 2  s . c  o  m
     * Performs an SHA1 hash of an input byte array
     */
    public static byte[] SHAHash(byte[] input) {
        try {
            final MessageDigest md = MessageDigest.getInstance("SHA-1");
            return md.digest(input);
        } catch (final NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. sha2(String password)
  2. sha2(String... data)
  3. sha5Encode(byte[] content)
  4. SHA_1(byte[] input)
  5. shaFile(String paramString)
  6. shaHash(String message)
  7. shaPsw(String inputText)
  8. SHAsum(byte[] convertme)
  9. SHAsum(byte[] convertme, boolean prefix, boolean uppercase)