Java SHA1 sha1Encode(byte[] content)

Here you can find the source of sha1Encode(byte[] content)

Description

sha Encode

License

Apache License

Declaration

public static byte[] sha1Encode(byte[] content) throws NoSuchAlgorithmException, InvalidKeyException 

Method Source Code


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

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

public class Main {
    public static byte[] sha1Encode(byte[] content) throws NoSuchAlgorithmException, InvalidKeyException {
        MessageDigest md = MessageDigest.getInstance("SHA");
        byte[] mdRes = md.digest(content);

        return mdRes;
    }//from   w  w w.j  ava  2  s .  c  o m
}

Related

  1. sha1Digest(byte[] bytes)
  2. sha1Digest(byte[] bytes)
  3. sha1Digest(final InputStream data)
  4. sha1Digest(String src)
  5. sha1DigestAsHex(String data)
  6. SHA1Encode(String sourceString)
  7. sha1Hash()
  8. sha1hash(byte[] blob)
  9. sha1Hash(byte[] data)