aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Common/getHashOfLoadedBinary.h
blob: 3a4a22b1bf1f31393cecb3cc4fb310997a47cc14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#pragma once

#include <string>
#include <Common/SipHash.h>

/** Calculate hash of the executable loaded segments of the first loaded object.
  * It can be used for integrity checks.
  * Does not work when ClickHouse is build as multiple shared libraries.
  * Note: we don't hash all loaded readonly segments, because some of them are modified by 'strip'
  *  and we want something that survives 'strip'.
  * Note: program behaviour can be affected not only by machine code but also by the data in these segments,
  * so the integrity check is going to be incomplete.
  */
SipHash getHashOfLoadedBinary();
std::string getHashOfLoadedBinaryHex();