Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for FromBytes (0.18 sec)

  1. android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

        Mac mac = Mac.getInstance("HmacMD5");
        mac.init(MD5_KEY);
        mac.update(input.getBytes(UTF_8));
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString());
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString());
        assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashString(input, UTF_8).toString());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

        Mac mac = Mac.getInstance("HmacMD5");
        mac.init(MD5_KEY);
        mac.update(input.getBytes(UTF_8));
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal()).toString());
        assertEquals(knownOutput, HashCode.fromBytes(mac.doFinal(input.getBytes(UTF_8))).toString());
        assertEquals(knownOutput, Hashing.hmacMd5(MD5_KEY).hashString(input, UTF_8).toString());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/hash/HashCodeTest.java

        for (ExpectedHashCode expected : expectedHashCodes) {
          HashCode fromBytes = HashCode.fromBytes(expected.bytes);
          assertExpectedHashCode(expected, fromBytes);
        }
      }
    
      public void testFromBytes_copyOccurs() {
        byte[] bytes = new byte[] {(byte) 0xcd, (byte) 0xab, (byte) 0x00, (byte) 0x00};
        HashCode hashCode = HashCode.fromBytes(bytes);
        int expectedInt = 0x0000abcd;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.1K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java

        try {
          MessageDigest digest = MessageDigest.getInstance(algorithmName);
          assertEquals(
              HashCode.fromBytes(digest.digest(input)), ALGORITHMS.get(algorithmName).hashBytes(input));
          for (int bytes = 4; bytes <= digest.getDigestLength(); bytes++) {
            assertEquals(
                HashCode.fromBytes(Arrays.copyOf(digest.digest(input), bytes)),
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/HashCodeTest.java

        for (ExpectedHashCode expected : expectedHashCodes) {
          HashCode fromBytes = HashCode.fromBytes(expected.bytes);
          assertExpectedHashCode(expected, fromBytes);
        }
      }
    
      public void testFromBytes_copyOccurs() {
        byte[] bytes = new byte[] {(byte) 0xcd, (byte) 0xab, (byte) 0x00, (byte) 0x00};
        HashCode hashCode = HashCode.fromBytes(bytes);
        int expectedInt = 0x0000abcd;
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.1K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java

        try {
          MessageDigest digest = MessageDigest.getInstance(algorithmName);
          assertEquals(
              HashCode.fromBytes(digest.digest(input)), ALGORITHMS.get(algorithmName).hashBytes(input));
          for (int bytes = 4; bytes <= digest.getDigestLength(); bytes++) {
            assertEquals(
                HashCode.fromBytes(Arrays.copyOf(digest.digest(input), bytes)),
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

        Sink(int chunkSize) {
          super(chunkSize);
          this.chunkSize = chunkSize;
          this.bufferSize = chunkSize;
        }
    
        @Override
        protected HashCode makeHash() {
          return HashCode.fromBytes(out.toByteArray());
        }
    
        @Override
        protected void process(ByteBuffer bb) {
          processCalled++;
          assertEquals(ByteOrder.LITTLE_ENDIAN, bb.order());
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/LittleEndianDataInputStream.java

       */
      @CanIgnoreReturnValue // to skip some bytes
      @Override
      public int readUnsignedShort() throws IOException {
        byte b1 = readAndCheckByte();
        byte b2 = readAndCheckByte();
    
        return Ints.fromBytes((byte) 0, (byte) 0, b2, b1);
      }
    
      /**
       * Reads an integer as specified by {@link DataInputStream#readInt()}, except using little-endian
       * byte order.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/primitives/ShortsTest.java

          fail();
        } catch (IllegalArgumentException expected) {
        }
      }
    
      @GwtIncompatible // Shorts.fromBytes
      public void testFromBytes() {
        assertThat(Shorts.fromBytes((byte) 0x23, (byte) 0x45)).isEqualTo((short) 0x2345);
        assertThat(Shorts.fromBytes((byte) 0xFE, (byte) 0xDC)).isEqualTo((short) 0xFEDC);
      }
    
      @GwtIncompatible // Shorts.fromByteArray, Shorts.toByteArray
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 26.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/hash/HashingTest.java

        assertEquals(hash32, Hashing.combineOrdered(ImmutableList.of(hash32)));
        assertEquals(
            HashCode.fromBytes(new byte[] {(byte) 0x80, 0, 0, 0}),
            Hashing.combineOrdered(ImmutableList.of(hash32, hash32)));
        assertEquals(
            HashCode.fromBytes(new byte[] {(byte) 0xa0, 0, 0, 0}),
            Hashing.combineOrdered(ImmutableList.of(hash32, hash32, hash32)));
        assertFalse(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 26.5K bytes
    - Viewed (0)
Back to top