MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / transform

Function transform

programs/obfuscator/Obfuscator.cpp:188–201  ·  view source on GitHub ↗

Pseudorandom permutation within set of numbers with the same log2(x).

Source from the content-addressed store, hash-verified

186
187/// Pseudorandom permutation within set of numbers with the same log2(x).
188static UInt64 transform(UInt64 x, UInt64 seed)
189{
190 /// Keep 0 and 1 as is.
191 if (x == 0 || x == 1)
192 return x;
193
194 /// Pseudorandom permutation of two elements.
195 if (x == 2 || x == 3)
196 return x ^ (seed & 1);
197
198 size_t num_leading_zeros = std::countl_zero(x);
199
200 return feistelNetwork(x, 64 - num_leading_zeros - 1, seed);
201}
202
203
204class UnsignedIntegerModel : public IModel

Callers 15

updateImplMethod · 0.85
updateImplMethod · 0.85
SHA1Engine.cppFile · 0.85
generateMethod · 0.85
transformSignedFunction · 0.85
generateMethod · 0.85
buildLogicalJoinFunction · 0.85
appendExpressionFunction · 0.85
buildJoinUsingConditionFunction · 0.85
concatClausesMethod · 0.85
getAllRegisteredNamesMethod · 0.85

Calls 1

feistelNetworkFunction · 0.85

Tested by 5

createHashJoinQueryPlanFunction · 0.68
TYPED_TESTFunction · 0.68
listAllBlobsFunction · 0.68
operator()Method · 0.68
toLowerFunction · 0.68