You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
831 B
C++

/*
** The crc hash is licensed under the Apache License, Version 2.0, and a copy of the license is included in this file.
**
**Author:Wang Yaofu voipman@qq.com
**Description: The header file of class CrcHash.
*/
#ifndef _COMMON_CRC_CRCHASH_H_
#define _COMMON_CRC_CRCHASH_H_
#include <string>
#include <stdint.h>
namespace common {
// string => 0x0000-0xffff
uint16_t Hash16(const std::string& key);
uint16_t Hash16(const char* cpKey, const int iKeyLen);
// string => 0x00000000-0xffffffff
uint32_t Hash32(const std::string& key);
uint32_t Hash32(const char* cpKey, const int iKeyLen);
// string => 0x0000000000000000-0xffffffffffffffff
uint64_t Hash64(const std::string& key);
uint64_t Hash64(const char* cpKey, const int iKeyLen);
} // namespace common
#endif // _COMMON_CRC_CRCHASH_H_