net.i2p.router.crypto.ratchet

## Class RatchetSessionTag

- java.lang.Object
- - net.i2p.router.crypto.ratchet.RatchetSessionTag

-     public class RatchetSessionTag
      extends Object

  8-byte session tag for ratchet protocol messages with efficient long-based storage representation for memory optimization Does not extend SessionTag or DataStructure to save space

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RatchetSessionTag(byte[] val)`
    `RatchetSessionTag(long val)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `byte[]` | `getData()`
    `long` | `getLong()`
    `int` | `hashCode()` We assume the data has enough randomness in it, so use 4 bytes for speed.
    `int` | `length()`
    `String` | `toBase64()` 12 chars
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### LENGTH

          public static final int LENGTH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RatchetSessionTag

          public RatchetSessionTag(byte[] val)

      Parameters:
        `val` - will copy the first 8 bytes. Reference will not be kept.

    - #### RatchetSessionTag

          public RatchetSessionTag(long val)

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getData

          public byte[] getData()

      Returns:
        data as a byte array

    - #### getLong

          public long getLong()

      Returns:
        data as a long value

    - #### hashCode

          public int hashCode()

      We assume the data has enough randomness in it, so use 4 bytes for speed.
      Overrides:
        `hashCode` in class `Object`

    - #### length

          public int length()

    - #### toBase64

          public String toBase64()

      12 chars

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`