mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Data obfuscator: development [#CLICKHOUSE-2]
This commit is contained in:
parent
bd5247864b
commit
3de1efa2c2
@ -18,6 +18,7 @@
|
||||
#include <DataStreams/IBlockOutputStream.h>
|
||||
#include <Common/SipHash.h>
|
||||
#include <Common/UTF8Helpers.h>
|
||||
#include <Common/StringUtils/StringUtils.h>
|
||||
#include <Common/HashTable/HashMap.h>
|
||||
#include <Common/typeid_cast.h>
|
||||
#include <Core/Block.h>
|
||||
@ -247,7 +248,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/// Just pseudorandom function.
|
||||
/// Pseudorandom function, but keep word characters as word characters.
|
||||
void transformFixedString(const UInt8 * src, UInt8 * dst, size_t size, UInt64 seed)
|
||||
{
|
||||
{
|
||||
@ -273,6 +274,15 @@ void transformFixedString(const UInt8 * src, UInt8 * dst, size_t size, UInt64 se
|
||||
pos += 16;
|
||||
++i;
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < size; ++j)
|
||||
{
|
||||
if (isWordCharASCII(src[j]))
|
||||
{
|
||||
static constexpr char word_chars[] = "_01234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
dst[j] = word_chars[dst[j] % sizeof(word_chars)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user