public class TorMessageDigest extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TOR_DIGEST_SIZE |
static int |
TOR_DIGEST256_SIZE |
| Constructor and Description |
|---|
TorMessageDigest() |
TorMessageDigest(boolean isDigest256) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getDigestBytes()
Return the digest value of all data processed up until this point.
|
HexDigest |
getHexDigest()
Calculate the digest value of all data processed up until this point and convert
the digest into a
HexDigest object. |
boolean |
isDigest256()
Return true if this is a 256 bit digest instance.
|
byte[] |
peekDigest(byte[] data,
int offset,
int length)
Return what the digest for the current running hash would be IF we
added
data, but don't really add the data to the digest
calculation. |
void |
update(byte[] input)
Add the entire contents of the byte array
input to the current digest calculation. |
void |
update(byte[] input,
int offset,
int length)
Add
length bytes of the contents of the byte array input beginning at
offset into the array to the current digest calculation. |
void |
update(String input)
Convert the String
input into an array of bytes using the ISO-8859-1 encoding
and add these bytes to the current digest calculation. |
public static final int TOR_DIGEST_SIZE
public static final int TOR_DIGEST256_SIZE
public TorMessageDigest(boolean isDigest256)
public TorMessageDigest()
public boolean isDigest256()
public byte[] getDigestBytes()
TOR_DIGEST_SIZE or TOR_DIGEST256_SIZE bytes.public byte[] peekDigest(byte[] data,
int offset,
int length)
data, but don't really add the data to the digest
calculation.public HexDigest getHexDigest()
HexDigest object.HexDigest object representing the current digest value.HexDigestpublic void update(byte[] input)
input to the current digest calculation.input - An array of input bytes to process.public void update(byte[] input,
int offset,
int length)
length bytes of the contents of the byte array input beginning at
offset into the array to the current digest calculation.input - An array of input bytes to process.offset - The offset into the input array to begin processing.length - A count of how many bytes of the input array to process.public void update(String input)
input into an array of bytes using the ISO-8859-1 encoding
and add these bytes to the current digest calculation.input - A string to process.Copyright © 2015. All rights reserved.