Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for putString (0.16 sec)

  1. android/guava/src/com/google/common/hash/Hasher.java

       * running the same hash function on the equivalent input. For cross-language compatibility, use
       * {@link #putString}, usually with a charset of UTF-8. For other use cases, use {@code
       * putUnencodedChars}.
       *
       * @since 15.0 (since 11.0 as putString(CharSequence)).
       */
      @CanIgnoreReturnValue
      @Override
      Hasher putUnencodedChars(CharSequence charSequence);
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 5.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

        assertEquals(
            HashCode.fromBytes(mac.doFinal("!!!".getBytes(UTF_8))),
            Hashing.hmacSha1(SHA1_KEY)
                .newHasher()
                .putString("hello", UTF_8)
                .putString("world", UTF_8)
                .putString("!!!", UTF_8)
                .hash());
      }
    
      public void testCustomKey() throws Exception {
        SecretKey customKey =
            new SecretKey() {
              @Override
    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)
  3. guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

        assertEquals(
            HashCode.fromBytes(mac.doFinal("!!!".getBytes(UTF_8))),
            Hashing.hmacSha1(SHA1_KEY)
                .newHasher()
                .putString("hello", UTF_8)
                .putString("world", UTF_8)
                .putString("!!!", UTF_8)
                .hash());
      }
    
      public void testCustomKey() throws Exception {
        SecretKey customKey =
            new SecretKey() {
              @Override
    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)
  4. guava-tests/test/com/google/common/hash/MessageDigestHashFunctionTest.java

          }
        }
      }
    
      public void testPutAfterHash() {
        Hasher sha1 = Hashing.sha1().newHasher();
    
        assertEquals(
            "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
            sha1.putString("The quick brown fox jumps over the lazy dog", Charsets.UTF_8)
                .hash()
                .toString());
        assertThrows(IllegalStateException.class, () -> sha1.putInt(42));
      }
    
      public void testHashTwice() {
    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/MessageDigestHashFunctionTest.java

          }
        }
      }
    
      public void testPutAfterHash() {
        Hasher sha1 = Hashing.sha1().newHasher();
    
        assertEquals(
            "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12",
            sha1.putString("The quick brown fox jumps over the lazy dog", Charsets.UTF_8)
                .hash()
                .toString());
        assertThrows(IllegalStateException.class, () -> sha1.putInt(42));
      }
    
      public void testHashTwice() {
    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)
  6. android/guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putBytes(s.getBytes(UTF_16LE)).hash());
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putString(s, UTF_16LE).hash());
        }
      }
    
      public void testFloat() {
        TestHasher hasher = new TestHasher();
        hasher.putFloat(Float.intBitsToFloat(0x04030201));
        hasher.assertBytes(new byte[] {1, 2, 3, 4});
      }
    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)
  7. android/guava/src/com/google/common/hash/Funnels.java

        StringCharsetFunnel(Charset charset) {
          this.charset = Preconditions.checkNotNull(charset);
        }
    
        @Override
        public void funnel(CharSequence from, PrimitiveSink into) {
          into.putString(from, charset);
        }
    
        @Override
        public String toString() {
          return "Funnels.stringFunnel(" + charset.name() + ")";
        }
    
        @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 25 20:32:46 GMT 2022
    - 7.3K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/hash/AbstractHasher.java

        for (int i = 0, len = charSequence.length(); i < len; i++) {
          putChar(charSequence.charAt(i));
        }
        return this;
      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putString(CharSequence charSequence, Charset charset) {
        return putBytes(charSequence.toString().getBytes(charset));
      }
    
      @Override
      @CanIgnoreReturnValue
      public Hasher putBytes(byte[] bytes) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 3.5K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putBytes(s.getBytes(UTF_16LE)).hash());
          assertEquals(
              new TestHasher().putUnencodedChars(s).hash(),
              new TestHasher().putString(s, UTF_16LE).hash());
        }
      }
    
      public void testFloat() {
        TestHasher hasher = new TestHasher();
        hasher.putFloat(Float.intBitsToFloat(0x04030201));
        hasher.assertBytes(new byte[] {1, 2, 3, 4});
      }
    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)
  10. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

          assertEquals(
              new Sink(4).putUnencodedChars(s).hash(),
              new Sink(4).putBytes(s.getBytes(UTF_16LE)).hash());
          assertEquals(
              new Sink(4).putUnencodedChars(s).hash(), new Sink(4).putString(s, UTF_16LE).hash());
        }
      }
    
      public void testFloat() {
        Sink sink = new Sink(4);
        sink.putFloat(Float.intBitsToFloat(0x04030201));
        HashCode unused = sink.hash();
        sink.assertInvariants(4);
    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)
Back to top