Java SHA1 sha1(byte[] data)

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

Description

sha

License

Apache License

Declaration

public static byte[] sha1(byte[] data) 

Method Source Code

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

import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.ProviderException;

public class Main {
    public static byte[] sha1(byte[] data) {
        try {/*from  w w w.  j a v a2s .  com*/
            MessageDigest md = MessageDigest.getInstance("SHA-1");
            md.update(data);
            return md.digest();
        } catch (GeneralSecurityException e) {
            throw new ProviderException(e.getMessage());
        }
    }
}

Related

  1. sha1(byte[] bytes)
  2. sha1(byte[] bytes)
  3. sha1(byte[] bytes)
  4. SHA1(byte[] convertme)
  5. SHA1(byte[] data)
  6. sha1(byte[] data)
  7. sha1(byte[] data)
  8. sha1(byte[] data)
  9. SHA1(byte[] input)