org.yestech.lib.crypto
Class MessageDigestUtils

java.lang.Object
  extended by org.yestech.lib.crypto.MessageDigestUtils

public class MessageDigestUtils
extends java.lang.Object

Class that implements Message Digest Algorithmns


Method Summary
static java.lang.String md5Hash(byte[] barray)
          Take a byte array and return its md5 MD5hash as a 32 hex digit string
static java.lang.String md5Hash(java.io.File file)
          Take a file and return its md5 MD5hash as a 32 hex digit string.
static java.lang.String md5Hash(java.io.InputStream stream)
          Take an InputStream and return its md5 MD5hash as a 32 hex digit string.
static java.lang.String md5Hash(java.lang.String arg)
          Take a string and return its md5 MD5hash as a 32 hex digit string
static java.lang.String sha1Hash(byte[] barray)
          Take a byte array and return its sha1 SHA1hash as a 40 hex digit string
static java.lang.String sha1Hash(java.io.File file)
          Take a file and return its sha1 SHA1hash as a 40 hex digit string.
static java.lang.String sha1Hash(java.io.InputStream stream)
          Take an InputStream and return its sha1 SHA1hash as a 40 hex digit string.
static java.lang.String sha1Hash(java.lang.String arg)
          Take a string and return its sha1 SHA1hash as a 40 hex digit string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

md5Hash

public static java.lang.String md5Hash(java.lang.String arg)
Take a string and return its md5 MD5hash as a 32 hex digit string

Parameters:
arg -
Returns:
the MD5

md5Hash

public static java.lang.String md5Hash(java.io.File file)
Take a file and return its md5 MD5hash as a 32 hex digit string. If the file is null then a null hash is returned.

Parameters:
file -
Returns:
the MD5

md5Hash

public static java.lang.String md5Hash(java.io.InputStream stream)
Take an InputStream and return its md5 MD5hash as a 32 hex digit string. If the stream is null then a null hash is returned.

Parameters:
stream -
Returns:
the MD5

md5Hash

public static java.lang.String md5Hash(byte[] barray)
Take a byte array and return its md5 MD5hash as a 32 hex digit string

Parameters:
barray -
Returns:
the MD5

sha1Hash

public static java.lang.String sha1Hash(java.io.File file)
Take a file and return its sha1 SHA1hash as a 40 hex digit string. If the file is null then a null hash is returned.

Parameters:
file -
Returns:
the SHA1

sha1Hash

public static java.lang.String sha1Hash(java.io.InputStream stream)
Take an InputStream and return its sha1 SHA1hash as a 40 hex digit string. If the stream is null then a null hash is returned.

Parameters:
stream -
Returns:
the SHA1

sha1Hash

public static java.lang.String sha1Hash(java.lang.String arg)
Take a string and return its sha1 SHA1hash as a 40 hex digit string

Parameters:
arg -
Returns:
the SHA1

sha1Hash

public static java.lang.String sha1Hash(byte[] barray)
Take a byte array and return its sha1 SHA1hash as a 40 hex digit string

Parameters:
barray -
Returns:
the SHA1


Copyright © 2009 YES Technology Association. All Rights Reserved.