Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for nextBytes (0.19 sec)

  1. guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java

      private int size;
    
      @Param HashFunctionEnum hashFunctionEnum;
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        random.nextBytes(testBytes);
      }
    
      @Benchmark
      int hasher(int reps) {
        HashFunction hashFunction = hashFunctionEnum.getHashFunction();
        int result = 37;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.3K bytes
    - Viewed (0)
  2. guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java

      private static final int RANDOM_SEED = new Random().nextInt();
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      @Benchmark
      byte hashing(int reps) {
        byte result = 0x01;
        HashMethod hashMethod = this.hashMethod;
        Algorithm algorithm = this.algorithm;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  3. guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java

        abstract boolean doEquals(byte[] a, byte[] b);
      }
    
      private byte[] testBytesA;
      private byte[] testBytesB;
    
      @BeforeExperiment
      void setUp() {
        testBytesA = new byte[size];
        random.nextBytes(testBytesA);
        testBytesB = Arrays.copyOf(testBytesA, size);
        int indexToDifferAt = -1;
        switch (whereToDiffer) {
          case ONE_PERCENT_IN:
            indexToDifferAt = (int) (size * 0.01);
            break;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.9K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/hash/HashCodeBenchmark.java

        abstract boolean doEquals(byte[] a, byte[] b);
      }
    
      private byte[] testBytesA;
      private byte[] testBytesB;
    
      @BeforeExperiment
      void setUp() {
        testBytesA = new byte[size];
        random.nextBytes(testBytesA);
        testBytesB = Arrays.copyOf(testBytesA, size);
        int indexToDifferAt = -1;
        switch (whereToDiffer) {
          case ONE_PERCENT_IN:
            indexToDifferAt = (int) (size * 0.01);
            break;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.9K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        hasher.assertBytes(new byte[] {1, 2});
      }
    
      public void testString() {
        Random random = new Random();
        for (int i = 0; i < 100; i++) {
          byte[] bytes = new byte[64];
          random.nextBytes(bytes);
          String s = new String(bytes, UTF_16LE); // so all random strings are valid
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java

      }
    
      public void testAgainstSimplerImplementation() {
        Random r = new Random(1234567);
        for (int length = 0; length < 1000; length++) {
          byte[] bytes = new byte[length];
          r.nextBytes(bytes);
          assertCrc(referenceCrc(bytes), bytes);
        }
      }
    
      private static int referenceCrc(byte[] bytes) {
        int crc = ~0;
        for (byte b : bytes) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Dec 23 18:30:33 GMT 2020
    - 6.5K bytes
    - Viewed (0)
  7. android/guava-tests/benchmark/com/google/common/io/BaseEncodingBenchmark.java

      @BeforeExperiment
      public void setUp() {
        Random rng = new Random();
        for (int i = 0; i < encodingInputs.length; i++) {
          encodingInputs[i] = new byte[n];
          rng.nextBytes(encodingInputs[i]);
          decodingInputs[i] = encoding.encoding.encode(encodingInputs[i]);
        }
      }
    
      @Benchmark
      public int encode(int reps) {
        int tmp = 0;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.2K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

        hasher.assertBytes(new byte[] {1, 2});
      }
    
      public void testString() {
        Random random = new Random();
        for (int i = 0; i < 100; i++) {
          byte[] bytes = new byte[64];
          random.nextBytes(bytes);
          String s = new String(bytes, UTF_16LE); // so all random strings are valid
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  9. android/guava-tests/benchmark/com/google/common/hash/MessageDigestAlgorithmBenchmark.java

      private static final int RANDOM_SEED = new Random().nextInt();
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        new Random(RANDOM_SEED).nextBytes(testBytes);
      }
    
      @Benchmark
      byte hashing(int reps) {
        byte result = 0x01;
        HashMethod hashMethod = this.hashMethod;
        Algorithm algorithm = this.algorithm;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.5K bytes
    - Viewed (0)
  10. android/guava-tests/benchmark/com/google/common/hash/HashFunctionBenchmark.java

      private int size;
    
      @Param HashFunctionEnum hashFunctionEnum;
    
      private byte[] testBytes;
    
      @BeforeExperiment
      void setUp() {
        testBytes = new byte[size];
        random.nextBytes(testBytes);
      }
    
      @Benchmark
      int hasher(int reps) {
        HashFunction hashFunction = hashFunctionEnum.getHashFunction();
        int result = 37;
        for (int i = 0; i < reps; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.3K bytes
    - Viewed (0)
Back to top