Class Transforms

java.lang.Object
org.symbol.sdk.utils.Transforms

public final class Transforms extends Object
Transforms
Cryptographic transform helpers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    keccak_256(byte[]... parts)
    Hashes the in-order concatenation of parts with Keccak-256 (the pre-standardisation SHA3 used by NEM).
    static byte[]
    ripemdKeccak256(byte[] payload)
    Hashes payload with Keccak-256 and then hashes the result with RIPEMD-160.
    static byte[]
    sha3_256(byte[]... parts)
    Hashes the in-order concatenation of parts with SHA3-256.
    static byte[]
    sha3_256(byte[] first, byte[] second)
    Hashes the concatenation of first and second with SHA3-256.

    Methods inherited from class java.lang.Object

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

    • sha3_256

      public static byte[] sha3_256(byte[] first, byte[] second)
      Transforms.sha3_256
      Hashes the concatenation of first and second with SHA3-256. Fixed-arity overload that avoids the byte[][] varargs allocation on the common two-part hashing paths (merkle node pairs, leaf hashes).
      Parameters:
      first - First input buffer.
      second - Second input buffer.
      Returns:
      32-byte SHA3-256 digest.
    • sha3_256

      public static byte[] sha3_256(byte[]... parts)
      Transforms.sha3_256
      Hashes the in-order concatenation of parts with SHA3-256.
      Parameters:
      parts - Input buffers to hash, in order.
      Returns:
      32-byte SHA3-256 digest.
    • keccak_256

      public static byte[] keccak_256(byte[]... parts)
      Transforms.keccak_256
      Hashes the in-order concatenation of parts with Keccak-256 (the pre-standardisation SHA3 used by NEM).
      Parameters:
      parts - Input buffers to hash, in order.
      Returns:
      32-byte Keccak-256 digest.
    • ripemdKeccak256

      public static byte[] ripemdKeccak256(byte[] payload)
      Transforms.ripemdKeccak256
      Hashes payload with Keccak-256 and then hashes the result with RIPEMD-160.
      Parameters:
      payload - Input buffer to hash.
      Returns:
      Hash result (20 bytes).