|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aspsimon.termcomp.infrastructure.utility.Hash
@Name(value="hash") public class Hash
This class offers a basic hashing functionality. Uses MessageDigest
from java.security to create the hash and Hex from
org.apache.commons.codec.binary to hex-encode the resulting
byte-array. Not quite sure where the idea for this class came from, but it
certainly works.
This class is basically a Seam component, and it should be accessed with the
static method Hash.getInstance().
| Constructor Summary | |
|---|---|
Hash()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getCharset()
Return the character set this object works with. |
java.lang.String |
getHashFunction()
Determine which hash function is used to generate the digest. |
static Hash |
getInstance()
Get an instance of this class. |
java.lang.String |
hash(java.lang.String password)
Create the required digest of a String. |
void |
setCharset(java.lang.String charset)
Change the default character set this object works with. |
void |
setHashFunction(java.lang.String hashFunction)
Set a different hash function for creating the digest. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Hash()
| Method Detail |
|---|
public java.lang.String hash(java.lang.String password)
String.
password - The string which should be hashed.
public java.lang.String getCharset()
UTF-8.
public void setCharset(java.lang.String charset)
UTF-8.
charset - The character set to use.public java.lang.String getHashFunction()
public void setHashFunction(java.lang.String hashFunction)
java.security.MessageDigest supports.
hashFunction - The hash function to be used.MessageDigestpublic static Hash getInstance()
Hash object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||