1
#pragma once
2

            
3
#include <cstdint>
4

            
5
#include "absl/strings/ascii.h"
6

            
7
namespace Envoy {
8
namespace Extensions {
9
namespace Clusters {
10
namespace Redis {
11

            
12
class Crc16 {
13
public:
14
  /**
15
   * XMODEM CRC16 implementation according to CITT standards.
16
   * Based on (https://github.com/antirez/redis/blob/unstable/src/crc16.c).
17
   * @param key The string to hash.
18
   * @return The CRC16 hash code.
19
   */
20
  static uint16_t crc16(absl::string_view key);
21
};
22
} // namespace Redis
23
} // namespace Clusters
24
} // namespace Extensions
25
} // namespace Envoy