ATLAS Offline Software
Loading...
Searching...
No Matches
crc_combine.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CXXUTILS_CRC_COMBINE_H
6#define CXXUTILS_CRC_COMBINE_H 1
7
8#include <string>
9#include <boost/crc.hpp>
10namespace CxxUtils {
13inline uint32_t crc_combine(uint32_t seed, uint32_t v) {
14 boost::crc_32_type crf;
15 crf.process_bytes(&seed, sizeof(uint32_t));
16 crf.process_bytes(&v, sizeof(uint32_t));
17 return crf.checksum();
18}
19
21inline uint32_t crc_combine(uint32_t seed, const std::string& v) {
22 boost::crc_32_type crf;
23 crf.process_bytes(&seed, sizeof(uint32_t));
24 crf.process_bytes(v.c_str(),v.size());
25 return crf.checksum();
26}
27}
28#endif
uint32_t crc_combine(uint32_t seed, uint32_t v)
Combines a 32-bit seed with another 32-bit value using CRC32.
Definition crc_combine.h:13