mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
27 lines
636 B
Java
27 lines
636 B
Java
package org.briarproject.api.identity;
|
|
|
|
import org.briarproject.api.UniqueId;
|
|
|
|
import java.nio.charset.Charset;
|
|
import java.util.Arrays;
|
|
|
|
/**
|
|
* Type-safe wrapper for a byte array that uniquely identifies an
|
|
* {@link org.briarproject.api.identity.Author Author}.
|
|
*/
|
|
public class AuthorId extends UniqueId {
|
|
|
|
/** Label for hashing authors to calculate their identities. */
|
|
public static final byte[] LABEL =
|
|
"AUTHOR_ID".getBytes(Charset.forName("US-ASCII"));
|
|
|
|
public AuthorId(byte[] id) {
|
|
super(id);
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
return o instanceof AuthorId && Arrays.equals(id, ((AuthorId) o).id);
|
|
}
|
|
}
|