Class CryptoHelper


  • public abstract class CryptoHelper
    extends Object
    Helper abstract class with crypto utility methods
    • Field Detail

      • DIGITS

        private static final char[] DIGITS
        The Constant DIGITS.
      • MASK_256

        private static final BigInteger MASK_256
    • Constructor Detail

      • CryptoHelper

        public CryptoHelper()
    • Method Detail

      • sha3

        public static String sha3​(String input)
        Given an input string return the result of sha3
        Parameters:
        input - string
        Returns:
        hashed message
      • soliditySha3

        public static byte[] soliditySha3​(Object... data)
        Given N objects, return the SHA3 of those objects
        Parameters:
        data - objects
        Returns:
        sha3
      • getHex

        public static String getHex​(byte[] data)
        Gets the hex.
        Parameters:
        data - the data
        Returns:
        the hex
      • toBytes

        public static byte[] toBytes​(Object obj)
        Given an object (byte[], BigInteger, Address, Uint or Number) gets the byte[] with the proper length
        Parameters:
        obj - the object
        Returns:
        byte[]