Class Numeric

java.lang.Object
org.web3j.utils.Numeric

public final class Numeric extends Object
Message codec functions.

Implementation as per https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding

  • Method Details

    • encodeQuantity

      public static String encodeQuantity(BigInteger value)
    • decodeQuantity

      public static BigInteger decodeQuantity(String value)
    • parsePaddedNumberHex

      public static BigInteger parsePaddedNumberHex(String value)
    • isValidHexQuantity

      protected static boolean isValidHexQuantity(String value)
    • cleanHexPrefix

      public static String cleanHexPrefix(String input)
    • prependHexPrefix

      public static String prependHexPrefix(String input)
    • containsHexPrefix

      public static boolean containsHexPrefix(String input)
    • toBigInt

      public static BigInteger toBigInt(byte[] value, int offset, int length)
    • toBigInt

      public static BigInteger toBigInt(byte[] value)
    • toBigInt

      public static BigInteger toBigInt(String hexValue)
    • toBigIntNoPrefix

      public static BigInteger toBigIntNoPrefix(String hexValue)
    • toHexStringWithPrefix

      public static String toHexStringWithPrefix(BigInteger value)
    • toHexStringNoPrefix

      public static String toHexStringNoPrefix(BigInteger value)
    • toHexStringNoPrefix

      public static String toHexStringNoPrefix(byte[] input)
    • toHexStringWithPrefixZeroPadded

      public static String toHexStringWithPrefixZeroPadded(BigInteger value, int size)
    • toHexStringWithPrefixSafe

      @Deprecated public static String toHexStringWithPrefixSafe(BigInteger value)
      Deprecated.
    • toHexStringNoPrefixZeroPadded

      public static String toHexStringNoPrefixZeroPadded(BigInteger value, int size)
    • toBytesPadded

      public static byte[] toBytesPadded(BigInteger value, int length)
    • hexStringToByteArray

      public static byte[] hexStringToByteArray(String input)
    • toHexString

      public static String toHexString(byte[] input, int offset, int length, boolean withPrefix)
    • toHexString

      public static String toHexString(byte[] input)
    • asByte

      public static byte asByte(int m, int n)
    • isIntegerValue

      public static boolean isIntegerValue(BigDecimal value)
    • removeDoubleQuotes

      public static String removeDoubleQuotes(String string)