Class EncodingHelper


  • public abstract class EncodingHelper
    extends Object
    • Constructor Detail

      • EncodingHelper

        public EncodingHelper()
    • Method Detail

      • stringToBytes32

        public static org.web3j.abi.datatypes.generated.Bytes32 stringToBytes32​(String input)
        Given a String return a Bytes32
        Parameters:
        input - input string
        Returns:
        Bytes32 output
      • byteArrayToByteArray32

        public static byte[] byteArrayToByteArray32​(byte[] byteValue)
        Given a byte array returns the first 32 bytes in a new byte array
        Parameters:
        byteValue - byte[]
        Returns:
        byte[]
      • padRightWithZero

        public static String padRightWithZero​(String input,
                                              int len)
        Pad a string with zero given a specific length
        Parameters:
        input - string
        len - length of the output string
        Returns:
        string
      • toHexString

        public static String toHexString​(byte[] input)
        Convert a byte[] to a hex string with 0x appended
        Parameters:
        input - byte[]
        Returns:
        hex string
      • isHexString

        public static boolean isHexString​(String input)
        Return true or false if a input string is in hex format
        Parameters:
        input - the input string
        Returns:
        bool
      • signatureToString

        public static String signatureToString​(org.web3j.crypto.Sign.SignatureData signatureData)