Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
FWCore
Utilities
src
Adler32Calculator.cc
Go to the documentation of this file.
1
#include "
FWCore/Utilities/interface/Adler32Calculator.h
"
2
3
namespace
cms {
4
5
//-------------------------------------------------------
6
// the following is adapted from
7
// http://en.wikipedia.org/wiki/Adler-32
8
//-------------------------------------------------------
9
10
void
11
Adler32
(
char
const
*
data
,
size_t
len, uint32_t&
a
, uint32_t&
b
) {
12
/* data: Pointer to the data to be summed; len is in bytes */
13
14
#define MOD_ADLER 65521
15
16
unsigned
char
const
* ptr =
static_cast<
unsigned
char
const
*
>
(
static_cast<
void
const
*
>
(
data
));
17
while
(len > 0) {
18
size_t
tlen = (len > 5552 ? 5552 : len);
19
len -= tlen;
20
do
{
21
a += *ptr++;
22
b +=
a
;
23
}
while
(--tlen);
24
25
a %=
MOD_ADLER
;
26
b %=
MOD_ADLER
;
27
}
28
29
#undef MOD_ADLER
30
}
31
32
uint32_t
33
Adler32
(
char
const
*
data
,
size_t
len) {
34
/* data: Pointer to the data to be summed; len is in bytes */
35
uint32_t
a
= 1,
b
= 0;
36
Adler32
(data, len, a,
b
);
37
return
(
b
<< 16) |
a
;
38
}
39
}
edmStreamStallGrapher.const
string const
Definition:
edmStreamStallGrapher.py:590
cms::Adler32
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
Definition:
Adler32Calculator.cc:11
b
double b
Definition:
hdecay.h:120
Adler32Calculator.h
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
a
double a
Definition:
hdecay.h:121
MOD_ADLER
#define MOD_ADLER
Generated for CMSSW Reference Manual by
1.8.5