Class Metadata

java.lang.Object
org.symbol.sdk.symbol.Metadata

public final class Metadata extends Object
Metadata
Symbol metadata helpers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    Generates a metadata key from a string seed: the first 8 bytes of SHA3-256(seed) read as a unsigned 64-bit integer with the top bit forced to one (matching the SDK V2 implementation).
    static byte[]
    updateValue(byte[] oldValue, byte[] newValue)
    Creates a metadata payload that updates oldValue to newValue: the XOR of the two values up to the shorter length, followed by the remaining bytes of the longer value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • generateKey

      public static long generateKey(String seed)
      Metadata.metadataGenerateKey
      Generates a metadata key from a string seed: the first 8 bytes of SHA3-256(seed) read as a unsigned 64-bit integer with the top bit forced to one (matching the SDK V2 implementation).
      Parameters:
      seed - Metadata key seed.
      Returns:
      Metadata key (64-bit two's-complement bit pattern).
    • updateValue

      public static byte[] updateValue(byte[] oldValue, byte[] newValue)
      Metadata.metadataUpdateValue
      Creates a metadata payload that updates oldValue to newValue: the XOR of the two values up to the shorter length, followed by the remaining bytes of the longer value.
      Parameters:
      oldValue - Old metadata value, or null when none exists.
      newValue - New metadata value.
      Returns:
      Metadata payload.