Java SHA SHA_1(byte[] input)

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

Description

SH_

License

Apache License

Declaration

static byte[] SHA_1(byte[] input) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Main {
    static byte[] SHA_1(byte[] input) {
        try {//from  w  w w  . j  a v a  2 s.  c o  m
            MessageDigest sha_1 = MessageDigest.getInstance("SHA-1");
            sha_1.update(input);
            return sha_1.digest();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. sha2(String content)
  2. sha2(String input)
  3. sha2(String password)
  4. sha2(String... data)
  5. sha5Encode(byte[] content)
  6. shaFile(String paramString)
  7. SHAHash(byte[] input)
  8. shaHash(String message)
  9. shaPsw(String inputText)