@Test public void testQuantityEncodeLeadingZero() { assertThat(Numeric.toHexStringWithPrefixSafe(BigInteger.valueOf(0L)), equalTo("0x00")); assertThat(Numeric.toHexStringWithPrefixSafe(BigInteger.valueOf(1024L)), equalTo("0x400")); assertThat(Numeric.toHexStringWithPrefixSafe(BigInteger.valueOf(Long.MAX_VALUE)), equalTo("0x7fffffffffffffff")); assertThat(Numeric.toHexStringWithPrefixSafe( new BigInteger("204516877000845695339750056077105398031")), equalTo("0x99dc848b94efc27edfad28def049810f")); }
public static String toHexStringWithPrefixSafe(BigInteger value) { String result = toHexStringNoPrefix(value); if (result.length() < 2) { result = Strings.zeros(1) + result; } return HEX_PREFIX + result; }
Numeric { public static String toHexStringWithPrefixSafe(BigInteger value) { String result = toHexStringNoPrefix(value); if (result.length() < 2) { result = Strings.zeros(1) + result; } return HEX_PREFIX + result; } }
Numeric { public static String toHexStringWithPrefixSafe(BigInteger value) { String result = toHexStringNoPrefix(value); if (result.length() < 2) { result = Strings.zeros(1) + result; } return HEX_PREFIX + result; } private  Numeric(); }
Numeric { public static String toHexStringWithPrefixSafe(BigInteger value) { String result = toHexStringNoPrefix(value); if (result.length() < 2) { result = Strings.zeros(1) + result; } return HEX_PREFIX + result; } private  Numeric(); static String encodeQuantity(BigInteger value); static BigInteger decodeQuantity(String value); static String cleanHexPrefix(String input); static String prependHexPrefix(String input); static boolean containsHexPrefix(String input); static BigInteger toBigInt(byte[] value, int offset, int length); static BigInteger toBigInt(byte[] value); static BigInteger toBigInt(String hexValue); static BigInteger toBigIntNoPrefix(String hexValue); static String toHexStringWithPrefix(BigInteger value); static String toHexStringNoPrefix(BigInteger value); static String toHexStringNoPrefix(byte[] input); static String toHexStringWithPrefixZeroPadded(BigInteger value, int size); static String toHexStringWithPrefixSafe(BigInteger value); static String toHexStringNoPrefixZeroPadded(BigInteger value, int size); static byte[] toBytesPadded(BigInteger value, int length); static byte[] hexStringToByteArray(String input); static String toHexString(byte[] input, int offset, int length, boolean withPrefix); static String toHexString(byte[] input); static byte asByte(int m, int n); static boolean isIntegerValue(BigDecimal value); }
Numeric { public static String toHexStringWithPrefixSafe(BigInteger value) { String result = toHexStringNoPrefix(value); if (result.length() < 2) { result = Strings.zeros(1) + result; } return HEX_PREFIX + result; } private  Numeric(); static String encodeQuantity(BigInteger value); static BigInteger decodeQuantity(String value); static String cleanHexPrefix(String input); static String prependHexPrefix(String input); static boolean containsHexPrefix(String input); static BigInteger toBigInt(byte[] value, int offset, int length); static BigInteger toBigInt(byte[] value); static BigInteger toBigInt(String hexValue); static BigInteger toBigIntNoPrefix(String hexValue); static String toHexStringWithPrefix(BigInteger value); static String toHexStringNoPrefix(BigInteger value); static String toHexStringNoPrefix(byte[] input); static String toHexStringWithPrefixZeroPadded(BigInteger value, int size); static String toHexStringWithPrefixSafe(BigInteger value); static String toHexStringNoPrefixZeroPadded(BigInteger value, int size); static byte[] toBytesPadded(BigInteger value, int length); static byte[] hexStringToByteArray(String input); static String toHexString(byte[] input, int offset, int length, boolean withPrefix); static String toHexString(byte[] input); static byte asByte(int m, int n); static boolean isIntegerValue(BigDecimal value);  }