Package 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
    Description
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    boolean
     
    byte[]
     
    int
    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
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • 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 Details

    • getData

      public byte[] getData()
    • length

      public int length()
    • 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
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object