gpt4 book ai didi

freenet.crypt.Yarrow.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:04:31 26 4
gpt4 key购买 nike

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

Yarrow.<init>介绍

暂无

代码示例

代码示例来源:origin: freenet/fred

RandomSource random = randomSource != null ? randomSource : new Yarrow();

代码示例来源:origin: freenet/fred

Yarrow r = new Yarrow(new File("/dev/urandom"), "SHA1", "Rijndael", true, false);

代码示例来源:origin: freenet/fred

public void testNextBoolean() {
    Yarrow y = new Yarrow(SEED_FILE, "SHA1", "Rijndael", false, false, false);
    int[] results = new int[2];
    int RUNS = 1000000;
    for(int i=0; i<RUNS; i++) {
      if(y.nextBoolean())
        results[0]++;
      else
        results[1]++;
    }

    assertEquals(RUNS, results[0]+results[1]);
    assertTrue(results[0] > RUNS/2 - RUNS/1000);
    assertTrue(results[1] > RUNS/2 - RUNS/1000);
  }
}

代码示例来源:origin: freenet/fred

public void testDouble() {
  Yarrow y = new Yarrow(SEED_FILE, "SHA1", "Rijndael", false, false, false);
  ScalarSampleStatistics sample = new ScalarSampleStatistics();
  for(int i = 0; i < 10000; ++i) {
    sample.add(y.nextDouble());
  }
  assertEquals(0.5, sample.getMean(), 0.02);
  assertEquals(1.0 / (2.0 * Math.sqrt(3.0)), sample.getStandardDeviation(), 0.002);
}

代码示例来源:origin: freenet/fred

entropyGatheringThread.start();
this.random = new Yarrow(seed);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com