java.lang.Comparable<MD5Hash>, Writable, WritableComparable<MD5Hash>@Public @Stable public class MD5Hash extends java.lang.Object implements WritableComparable<MD5Hash>
| Modifier and Type | Class | Description |
|---|---|---|
static class |
MD5Hash.Comparator |
A WritableComparator optimized for MD5Hash keys.
|
| Modifier and Type | Field | Description |
|---|---|---|
static int |
MD5_LEN |
| Constructor | Description |
|---|---|
MD5Hash() |
Constructs an MD5Hash.
|
MD5Hash(byte[] digest) |
Constructs an MD5Hash with a specified value.
|
MD5Hash(java.lang.String hex) |
Constructs an MD5Hash from a hex string.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo(MD5Hash that) |
Compares this object with the specified object for order.
|
static MD5Hash |
digest(byte[] data) |
Construct a hash value for a byte array.
|
static MD5Hash |
digest(byte[][] dataArr,
int start,
int len) |
Construct a hash value for an array of byte array.
|
static MD5Hash |
digest(byte[] data,
int start,
int len) |
Construct a hash value for a byte array.
|
static MD5Hash |
digest(java.io.InputStream in) |
Construct a hash value for the content from the InputStream.
|
static MD5Hash |
digest(java.lang.String string) |
Construct a hash value for a String.
|
static MD5Hash |
digest(UTF8 utf8) |
Construct a hash value for a String.
|
boolean |
equals(java.lang.Object o) |
Returns true iff
o is an MD5Hash whose digest contains the
same values. |
byte[] |
getDigest() |
Returns the digest bytes.
|
static java.security.MessageDigest |
getDigester() |
Create a thread local MD5 digester.
|
long |
halfDigest() |
Construct a half-sized version of this MD5.
|
int |
hashCode() |
Returns a hash code value for this object.
|
int |
quarterDigest() |
Return a 32-bit digest of the MD5.
|
static MD5Hash |
read(java.io.DataInput in) |
Constructs, reads and returns an instance.
|
void |
readFields(java.io.DataInput in) |
Deserialize the fields of this object from
in. |
void |
set(MD5Hash that) |
Copy the contents of another instance into this instance.
|
void |
setDigest(java.lang.String hex) |
Sets the digest value from a hex string.
|
java.lang.String |
toString() |
Returns a string representation of this object.
|
void |
write(java.io.DataOutput out) |
Serialize the fields of this object to
out. |
public static final int MD5_LEN
public MD5Hash()
public MD5Hash(java.lang.String hex)
hex - input hex.public MD5Hash(byte[] digest)
digest - digest.public void readFields(java.io.DataInput in)
throws java.io.IOException
Writablein.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.java.io.IOException - any other problem for readFields.public static MD5Hash read(java.io.DataInput in) throws java.io.IOException
in - in.java.io.IOException - raised on errors performing I/O.public void write(java.io.DataOutput out)
throws java.io.IOException
Writableout.public void set(MD5Hash that)
that - that.public byte[] getDigest()
public static MD5Hash digest(byte[] data)
data - data.public static java.security.MessageDigest getDigester()
public static MD5Hash digest(java.io.InputStream in) throws java.io.IOException
in - input stream.java.io.IOException - raised on errors performing I/O.public static MD5Hash digest(byte[] data, int start, int len)
data - data.start - start.len - len.public static MD5Hash digest(byte[][] dataArr, int start, int len)
dataArr - dataArr.start - start.len - len.public static MD5Hash digest(java.lang.String string)
string - string.public static MD5Hash digest(UTF8 utf8)
utf8 - utf8.public long halfDigest()
public int quarterDigest()
public boolean equals(java.lang.Object o)
o is an MD5Hash whose digest contains the
same values.equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(MD5Hash that)
compareTo in interface java.lang.Comparable<MD5Hash>public java.lang.String toString()
toString in class java.lang.Objectpublic void setDigest(java.lang.String hex)
hex - hex.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.