net.i2p.data.Hash.setData()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(106)

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

Hash.setData介绍

暂无

代码示例

代码示例来源:origin: i2p/i2p.i2p

/** @throws IllegalArgumentException if data is not 32 bytes (null is ok) */
public Hash(byte data[]) {
  super();
  setData(data);
}

代码示例来源:origin: i2p/i2p.i2p

public DataStructure createDataStructure() throws DataFormatException {
  Hash hash = new Hash();
  byte data[] = new byte[32];
  for (int i = 0; i < data.length; i++)
    data[i] = (byte)(i%16);
  hash.setData(data);
  return hash; 
}
public DataStructure createStructureToRead() { return new Hash(); }

代码示例来源:origin: i2p/i2p.i2p

public DataStructure createDataStructure() throws DataFormatException {
  DeliveryInstructions instructions = new DeliveryInstructions();
  //instructions.setDelayRequested(true);
  //instructions.setDelaySeconds(42);
  instructions.setDeliveryMode(DeliveryInstructions.DELIVERY_MODE_TUNNEL);
      // encryption key read/write disabled
  //instructions.setEncrypted(true);
  //SessionKey key = new SessionKey();
  //byte keyData[] = new byte[SessionKey.KEYSIZE_BYTES];
  //for (int i = 0; i < keyData.length; i++) 
  //    keyData[i] = (byte)i;
  //key.setData(keyData);
  //instructions.setEncryptionKey(key);
  Hash hash = new Hash();
  byte hashData[] = new byte[32];
  for (int i = 0; i < hashData.length; i++)
    hashData[i] = (byte)(i%32);
  hash.setData(hashData);
  instructions.setRouter(hash);
  TunnelId id = new TunnelId();
  id.setTunnelId(666);
  instructions.setTunnelId(id);
  
  return instructions;
}
public DataStructure createStructureToRead() { return new DeliveryInstructions(); }

代码示例来源:origin: i2p/i2p.i2p

for (int i = 0; i < numHops; i++) {
  peers[i] = new Hash();
  peers[i].setData(new byte[Hash.HASH_LENGTH]);
  _context.random().nextBytes(peers[i].getData());
  _context.random().nextBytes(tunnelIds[i]);

代码示例来源:origin: i2p/i2p.i2p

for (int i = 0; i < numHops; i++) {
  peers[i] = new Hash();
  peers[i].setData(new byte[Hash.HASH_LENGTH]);
  _context.random().nextBytes(peers[i].getData());
  _context.random().nextBytes(tunnelIds[i]);

相关文章