@PublicationReference(author="Wikipedia",title="SHA-1",type=WebPage,year=2011,url="http://en.wikipedia.org/wiki/SHA-1") @PublicationReference(author="Sam Ruby",title="SHA1.java",type=WebPage,year=2004,url="http://intertwingly.net/stories/2004/07/18/SHA1.java") public class SHA1Hash extends AbstractHashFunction
| Modifier and Type | Field and Description |
|---|---|
protected static byte[] |
DEFAULT_SEED
Default seed
|
static int |
LENGTH
SHA-1 hash function output is 160-bits or 20-bytes, 20.
|
| Constructor and Description |
|---|
SHA1Hash()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
evaluateInto(byte[] input,
byte[] output,
byte[] seed)
Evaluates the input into the given output
|
byte[] |
getDefaultSeed()
Gets the default seed for the hash function
|
static byte[] |
hash(byte[] input)
Computes the SHA-1 representation of the given input.
|
static void |
hash(byte[] input,
byte[] output)
Computes the SHA-1 representation of the given input.
|
static void |
hash(byte[] x,
byte[] output,
byte[] seed)
Computes the SHA-1 representation of the given input and seed.
|
int |
length()
Returns the number of bytes in the output hash code.
|
clone, evaluate, evaluate, evaluateIntopublic static final int LENGTH
protected static final byte[] DEFAULT_SEED
public static byte[] hash(byte[] input)
input - Input byte array to compute the SHA-1 hash of.public static void hash(byte[] input,
byte[] output)
input - Input byte array to compute the SHA-1 hash of.output - Output to store the hash intopublic static void hash(byte[] x,
byte[] output,
byte[] seed)
x - Input byte array to compute the SHA-1 hash of.seed - Seed to use to offset the hash functionoutput - 160-bit (20-byte) SHA-1 representation of the input and seed.public void evaluateInto(byte[] input,
byte[] output,
byte[] seed)
HashFunctioninput - Input to compute the hash-function value ofoutput - Output to put the hash-function intoseed - Seed to offset the hash code.public int length()
HashFunctionpublic byte[] getDefaultSeed()
HashFunction