|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.awakefw.commons.api.server.util.Sha1
public class Sha1
SHA-1 hash functions on strings and files with SUN provider.
Constructor Summary | |
---|---|
Sha1()
Constructor. |
Method Summary | |
---|---|
byte[] |
getFileHash(File file)
Gets the a file hash value. |
byte[] |
getHash(byte[] b)
Computes the SHA-1 hash code of a byte array as an hex string. |
String |
getHexFileHash(File file)
Gets the file hash as an hex string value. |
String |
getHexHash(byte[] b)
Computes the hash code of a byte array as an hex string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sha1()
Method Detail |
---|
public byte[] getFileHash(File file) throws IOException, NoSuchAlgorithmException, NoSuchProviderException
file
- the file to hash
IOException
- an I/O error occurred
NoSuchAlgorithmException
- hash algorithm not found
NoSuchProviderException
- hash provider not foundpublic byte[] getHash(byte[] b) throws NoSuchAlgorithmException, NoSuchProviderException
b
- the bytes to hash
NoSuchAlgorithmException
- if the algorithm is not available from the provide
NoSuchProviderException
- if the provider is not available in the environmentpublic String getHexFileHash(File file) throws IOException, NoSuchAlgorithmException, NoSuchProviderException
file
- the file to hash
IOException
- an I/O error occurred
NoSuchAlgorithmException
- hash algorithm not found
NoSuchProviderException
- hash provider not foundpublic String getHexHash(byte[] b) throws NoSuchAlgorithmException, NoSuchProviderException
b
- the bytes to hash NoSuchAlgorithmException
- if the algorithm is not available from the provider
NoSuchProviderException
- if the provider is not available in the environment
|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |