1package com.bumptech.glide.load;
2
3import java.io.UnsupportedEncodingException;
4import java.security.MessageDigest;
5
6/**
7 * An interface that uniquely identifies some set of data. Implementations must implement {@link Object#equals(Object)}
8 * and {@link Object#hashCode()}. Implementations are generally expected to add all uniquely identifying information
9 * used in in {@link java.lang.Object#equals(Object)}} and {@link Object#hashCode()}} to the given
10 * {@link java.security.MessageDigest} in {@link #updateDiskCacheKey(java.security.MessageDigest)}}, although this
11 * requirement is not as strict for partial cache key signatures.
12 */
13public interface Key {
14    String STRING_CHARSET_NAME = "UTF-8";
15
16    /**
17     * Adds all uniquely identifying information to the given digest.
18     *
19     * <p>
20     *     Note - Using {@link java.security.MessageDigest#reset()} inside of this method will result in undefined
21     *     behavior.
22     * </p>
23     */
24    void updateDiskCacheKey(MessageDigest messageDigest) throws UnsupportedEncodingException;
25
26    @Override
27    boolean equals(Object o);
28
29    @Override
30    int hashCode();
31}
32