net.i2p.data

## Class SessionTag

- java.lang.Object
- - net.i2p.data.SessionTag

-     public class SessionTag
      extends Object

  32 bytes, usually of random data. Not recommended for external use, subject to change. As of 0.9.44, does NOT extend SimpleDataStructure, to save space

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionTag()` Instantiate the data array and fill it with random data.
    `SessionTag(boolean create)` Instantiate the data array and fill it with random data.
    `SessionTag(byte[] val)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `byte[]` | `getData()`
    `int` | `hashCode()` SessionTags are generated both locally and by peers, in quantity, and are used as keys in several datastructures (see TransientSessionKeyManager), so we use a secure hashCode function.
    `int` | `length()`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### BYTE_LENGTH

          public static final int BYTE_LENGTH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SessionTag

          public SessionTag()

      Instantiate the data array and fill it with random data.

    - #### SessionTag

          public SessionTag(boolean create)

      Instantiate the data array and fill it with random data.
      Parameters:
        `create` - ignored as of 0.9.44, assumed true

    - #### SessionTag

          public SessionTag(byte[] val)

      Parameters:
        `val` - as of 0.9.44, non-null

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getData

          public byte[] getData()

    - #### hashCode

          public int hashCode()

      SessionTags are generated both locally and by peers, in quantity, and are used as keys in several datastructures (see TransientSessionKeyManager), so we use a secure hashCode function.
      Overrides:
        `hashCode` in class `Object`

    - #### length

          public int length()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`