org.apache.hc.client5.http.impl.cache.memcached

## Class SHA256KeyHashingScheme

- java.lang.Object
- - org.apache.hc.client5.http.impl.cache.memcached.SHA256KeyHashingScheme

- All Implemented Interfaces:
    KeyHashingScheme

      public final class SHA256KeyHashingScheme
      extends Object
      implements KeyHashingScheme

  This is a `KeyHashingScheme` based on the SHA-256 algorithm. The hashes produced are hex-encoded SHA-256 digests and hence are always 64-character hexadecimal strings.
  Since:
    4.1

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SHA256KeyHashingScheme` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SHA256KeyHashingScheme()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `hash(String key)` Maps a storage key to a cache key.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final SHA256KeyHashingScheme INSTANCE

  - ### Constructor Detail

    - #### SHA256KeyHashingScheme

          public SHA256KeyHashingScheme()

  - ### Method Detail

    - #### hash

          public String hash(String key)

      Description copied from interface: `KeyHashingScheme`
      Maps a storage key to a cache key. The storage key is what the higher-level HTTP cache uses as a key; the cache key is what we use as a key for talking to memcached.
      Specified by:
        `hash` in interface `KeyHashingScheme`
      Parameters:
        `key` - what the higher-level HTTP cache wants to use as its key for looking up cache entries
      Returns:
        a cache key suitable for use with memcached

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.