public class RatchetSessionTag extends Object
| Modifier and Type | Field and Description |
|---|---|
static int | LENGTHLength of the tag in bytes |
| Constructor and Description |
|---|
RatchetSessionTag(byte[] val)First 8 bytes of the given value are copied; the reference is not kept. |
RatchetSessionTag(long val)Tag from a long value for compact 8-byte storage. |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object obj)Compares by long value for fast identity. |
byte[] | getData()The tag as a byte array. |
long | getLong()The tag as a long value. |
int | hashCode()We assume the data has enough randomness in it, so use 4 bytes for speed. |
int | length()Tag size in bytes (always 8). |
String | toBase64()12 chars |
String | toString()Base64-encoded tag string. |
public static final int LENGTH
public RatchetSessionTag(byte[] val)
val - will copy the first 8 bytes. Reference will not be kept.public RatchetSessionTag(long val)
public boolean equals(Object obj)
public byte[] getData()
public long getLong()
public int hashCode()
public int length()
public String toBase64()