public final class Digests extends NotInstantiable
Modifier and Type | Field and Description |
---|---|
static String |
MD5
Algorithm: MD5.
|
static String |
SHA1
Algorithm: SHA-1.
|
static String |
SHA256
Algorithm: SHA-256.
|
static String |
SHA512
Algorithm: SHA-512.
|
Modifier and Type | Method and Description |
---|---|
static ByteString |
getDigest(byte[] data,
MessageDigest md)
Computes and returns as a byte string the digest of the provided data.
|
static ByteString |
getDigest(ByteSource source,
MessageDigest md)
Computes and returns as a byte string the digest of the provided data.
|
static MessageDigest |
getInstance(String algorithm)
Creates a new instance.
|
static MessageDigest |
md5()
Returns a Digest object that implements the MD5 algorithm.
|
static ByteString |
md5(byte[] data)
Computes and returns as a byte string the MD5 digest of the provided data.
|
static ByteString |
md5(ByteSource source)
Computes and returns as a byte string the MD5 digest of the provided data.
|
static MessageDigest |
sha1()
Returns a Digest object that implements the SHA-1 algorithm.
|
static ByteString |
sha1(byte[] data)
Computes and returns as a byte string the SHA-1 digest of the provided data.
|
static ByteString |
sha1(ByteSource source)
Computes and returns as a byte string the SHA-1 digest of the provided data.
|
static MessageDigest |
sha256()
Returns a Digest object that implements the SHA-256 algorithm.
|
static ByteString |
sha256(byte[] data)
Computes and returns as a byte string the SHA-256 digest of the provided data.
|
static ByteString |
sha256(ByteSource source)
Computes and returns as a byte string the SHA-256 digest of the provided data.
|
static MessageDigest |
sha512()
Returns a Digest object that implements the SHA-512 algorithm.
|
static ByteString |
sha512(byte[] data)
Computes and returns as a byte string the SHA-512 digest of the provided data.
|
static ByteString |
sha512(ByteSource source)
Computes and returns as a byte string the SHA-512 digest of the provided data.
|
public static final String MD5
public static final String SHA1
public static final String SHA256
public static final String SHA512
public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException
algorithm
- Digest algorithm.NoSuchAlgorithmException
- If the algorithm is not available in the caller's environment.public static ByteString getDigest(byte[] data, MessageDigest md)
public static ByteString getDigest(ByteSource source, MessageDigest md) throws IOException
IOException
public static MessageDigest md5()
public static ByteString md5(byte[] data)
public static ByteString md5(ByteSource source) throws IOException
IOException
public static MessageDigest sha1()
public static ByteString sha1(byte[] data)
public static ByteString sha1(ByteSource source) throws IOException
IOException
public static MessageDigest sha256()
public static ByteString sha256(byte[] data)
public static ByteString sha256(ByteSource source) throws IOException
IOException
public static MessageDigest sha512()
public static ByteString sha512(byte[] data)
public static ByteString sha512(ByteSource source) throws IOException
IOException
Copyright © 2014 Derquinse Projects. All rights reserved.