本文整理汇总了Java中com.subgraph.orchid.encoders.Hex类的典型用法代码示例。如果您正苦于以下问题:Java Hex类的具体用法?Java Hex怎么用?Java Hex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Hex类属于com.subgraph.orchid.encoders包,在下文中一共展示了Hex类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHidServAuth
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
@Test
public void testHidServAuth() {
final String address = "3t43tfluce4qcxbo";
final String onion = address + ".onion";
final String hex = "022b99d1d272285c80f7214bd6c07c27";
final String descriptor = "AiuZ0dJyKFyA9yFL1sB8Jw";
assertNull(config.getHidServAuth(onion));
config.addHidServAuth(onion, descriptor);
HSDescriptorCookie cookie = config.getHidServAuth(onion);
assertNotNull(cookie);
assertEquals(hex, new String(Hex.encode(cookie.getValue())));
assertSame(cookie, config.getHidServAuth(address));
}
示例2: createFromString
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
public static HexDigest createFromString(String fingerprint) {
final String[] parts = fingerprint.split(" ");
if(parts.length > 1)
return createFromStringList(Arrays.asList(parts));
final byte[] digestData = Hex.decode(fingerprint);
return new HexDigest(digestData);
}
示例3: checkSignature
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
boolean checkSignature()
{
String masterPubKey = params.getId().equals(NetworkParameters.ID_TESTNET) ? testPubKey : mainPubKey;
try {
ECKey key = new ECKey(null, Hex.decode(masterPubKey));
if(!key.verify(getHash().getBytes(), signature))
return false;
}
catch (Exception e)
{
return false;
}
return true;
}
示例4: toString
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
public String toString() {
return new String(Hex.encode(digestBytes));
}
示例5: toString
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
public String toString() {
return "TorSignature: (" + signatureBytes.length + " bytes) " + new String(Hex.encode(signatureBytes));
}
示例6: createBuffer
import com.subgraph.orchid.encoders.Hex; //导入依赖的package包/类
ByteBuffer createBuffer(String hexData) {
final byte[] bs = Hex.decode(hexData);
return ByteBuffer.wrap(bs);
}