21#ifndef XRDCLHTTPCHECKSUM_HH_
22#define XRDCLHTTPCHECKSUM_HH_
85 if (str ==
"adler" || str ==
"adler32") {
87 }
else if (str ==
"crc32") {
89 }
else if (str ==
"crc32c") {
91 }
else if (str ==
"md5") {
93 }
else if (str ==
"sha1") {
95 }
else if (str ==
"sha256") {
105 std::array<unsigned char, g_max_checksum_length>
value;
131 const std::array<unsigned char, g_max_checksum_length> &
Get(
ChecksumType ctype)
const {
134 return checksums[
static_cast<size_t>(ctype)].value;
140 bool Set(
ChecksumType ctype,
const std::array<unsigned char, g_max_checksum_length> &value) {
142 checksums[
static_cast<size_t>(ctype)] =
ChecksumEntry{ctype, value};
149 std::tuple<ChecksumType, std::array<unsigned char, g_max_checksum_length>,
bool>
GetFirst()
const {
152 return std::make_tuple(
static_cast<ChecksumType>(idx), checksums[idx].value,
true);
155 return std::make_tuple(
ChecksumType::kUnknown, std::array<unsigned char, g_max_checksum_length>(),
false);
const std::array< unsigned char, g_max_checksum_length > & Get(ChecksumType ctype) const
bool IsSet(ChecksumType ctype) const
bool Set(ChecksumType ctype, const std::array< unsigned char, g_max_checksum_length > &value)
std::tuple< ChecksumType, std::array< unsigned char, g_max_checksum_length >, bool > GetFirst() const
size_t GetChecksumLength(ChecksumType ctype)
constexpr size_t g_max_checksum_length
ChecksumType GetTypeFromString(const std::string &str)
std::array< unsigned char, g_max_checksum_length > value
const std::string GetTypeString(ChecksumType ctype)