Class SasBytes

java.lang.Object
io.github.fherbreteau.vodozemac.sas.SasBytes

public final class SasBytes extends Object
Bytes generated from a shared secret that can be used as the short authentication string (SAS).

The bytes can be converted into emoji indices or decimal numbers for visual key verification, as described in the Matrix spec.

Author:
François HERBRETEAU
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the raw 6 bytes of the short authentication string that are converted into the emoji and decimal representations.
    Returns the three decimal numbers that can be presented to users to perform the key verification.
    int[]
    Returns the indices of 7 emojis that can be presented to users to perform the key verification.
    boolean
     
    int
     
     

    Methods inherited from class Object

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

    • emojiIndices

      public int[] emojiIndices()
      Returns the indices of 7 emojis that can be presented to users to perform the key verification.

      The table that maps each index to an emoji can be found in the Matrix spec.

      Returns:
      an array of 7 emoji indices
    • decimals

      public String[] decimals()
      Returns the three decimal numbers that can be presented to users to perform the key verification.
      Returns:
      an array of three decimal strings
    • bytes

      public byte[] bytes()
      Returns the raw 6 bytes of the short authentication string that are converted into the emoji and decimal representations.
      Returns:
      an array of 6 raw bytes
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object