|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.common.text.SecureHashTextEncoder
public class SecureHashTextEncoder

A text encoder that performs a secure hash of the input text and returns that hash as the encoded text. This encoder can be configured to use different secure hash algorithms and to return a fixed number of characters from the hash.
| Constructor Summary | |
|---|---|
SecureHashTextEncoder(SecureHash.Algorithm algorithm)
Create an encoder that uses the supplied algorithm and returns only the supplied number of characters in the hash. |
|
SecureHashTextEncoder(SecureHash.Algorithm algorithm,
int maxLength)
Create an encoder that uses the supplied algorithm and returns only the supplied number of characters in the hash. |
|
| Method Summary | |
|---|---|
String |
encode(String text)
Returns the encoded version of a string. |
SecureHash.Algorithm |
getAlgorithm()
Return the secure hash algorithm used by this encoder. |
int |
getMaxLength()
Get the maximum length of the encoded string, or Integer.MAX_VALUE if there is no maximum. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SecureHashTextEncoder(SecureHash.Algorithm algorithm)
algorithm - the algorithm that should be used
IllegalArgumentException - if the algorithm is null
public SecureHashTextEncoder(SecureHash.Algorithm algorithm,
int maxLength)
algorithm - the algorithm that should be usedmaxLength - the maximumLength, or a non-positive number (or Integer.MAX_VALUE) if the full hash should be used
IllegalArgumentException - if the algorithm is null| Method Detail |
|---|
public int getMaxLength()
Integer.MAX_VALUE if there is no maximum.
public SecureHash.Algorithm getAlgorithm()
public String encode(String text)
encode in interface TextEncodertext - the text with characters that are to be encoded.
TextEncoder.encode(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||