org.web3j.utils.Numeric.toHexStringWithPrefixZeroPadded()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.web3j.utils.Numeric.toHexStringWithPrefixZeroPadded()方法的一些代码示例,展示了Numeric.toHexStringWithPrefixZeroPadded()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Numeric.toHexStringWithPrefixZeroPadded()方法的具体详情如下:
包路径:org.web3j.utils.Numeric
类名称:Numeric
方法名:toHexStringWithPrefixZeroPadded

Numeric.toHexStringWithPrefixZeroPadded介绍

暂无

代码示例

代码示例来源:origin: web3j/web3j

@Override
public String toString() {
  return Numeric.toHexStringWithPrefixZeroPadded(
      value.getValue(), LENGTH_IN_HEX);
}

代码示例来源:origin: web3j/web3j

public static String getAddress(BigInteger publicKey) {
  return getAddress(
      Numeric.toHexStringWithPrefixZeroPadded(publicKey, PUBLIC_KEY_LENGTH_IN_HEX));
}

代码示例来源:origin: web3j/web3j

@Test
public void testToHexStringWithPrefixZeroPadded() {
  assertThat(
      Numeric.toHexStringWithPrefixZeroPadded(
          BigInteger.ZERO,
          5),
      is("0x00000"));
  assertThat(
      Numeric.toHexStringWithPrefixZeroPadded(
          new BigInteger("01c52b08330e05d731e38c856c1043288f7d9744", 16),
          40),
      is("0x01c52b08330e05d731e38c856c1043288f7d9744"));
  assertThat(
      Numeric.toHexStringWithPrefixZeroPadded(
          new BigInteger("01c52b08330e05d731e38c856c1043288f7d9744", 16),
          40),
      is("0x01c52b08330e05d731e38c856c1043288f7d9744"));
}

代码示例来源:origin: org.web3j/abi

@Override
public String toString() {
  return Numeric.toHexStringWithPrefixZeroPadded(
      value.getValue(), LENGTH_IN_HEX);
}

代码示例来源:origin: io.daonomic.scalether/util

public static String getAddress(BigInteger publicKey) {
  return getAddress(
    Numeric.toHexStringWithPrefixZeroPadded(publicKey, PUBLIC_KEY_LENGTH_IN_HEX));
}

代码示例来源:origin: org.web3j/crypto

public static String getAddress(BigInteger publicKey) {
  return getAddress(
      Numeric.toHexStringWithPrefixZeroPadded(publicKey, PUBLIC_KEY_LENGTH_IN_HEX));
}

相关文章