Class Merkle


  • public class Merkle
    extends Object

    Merkle class.

    • Method Detail

      • merkleParent

        public static byte[] merkleParent​(byte[] hash0,
                                          byte[] hash1)
        Takes the binary hashes and calculates the hash256
        Parameters:
        hash0 - an array of byte objects
        hash1 - an array of byte objects
        Returns:
        an array of byte objects
      • merkleParentLevel

        public static List<byte[]> merkleParentLevel​(List<byte[]> hashes)
        Takes a list of binary hashes and returns a list that's half the length
        Parameters:
        hashes - a List object
        Returns:
        a List object
      • merkleRoot

        public static byte[] merkleRoot​(List<byte[]> hashes)
        Takes a list of binary hashes and returns the merkle root
        Parameters:
        hashes - a List object
        Returns:
        an array of byte objects