mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
86acb61849
2
contrib/krb5
vendored
2
contrib/krb5
vendored
@ -1 +1 @@
|
|||||||
Subproject commit b89e20367b074bd02dd118a6534099b21e88b3c3
|
Subproject commit f8262a1b548eb29d97e059260042036255d07f8d
|
@ -15,6 +15,10 @@ if(NOT AWK_PROGRAM)
|
|||||||
message(FATAL_ERROR "You need the awk program to build ClickHouse with krb5 enabled.")
|
message(FATAL_ERROR "You need the awk program to build ClickHouse with krb5 enabled.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT (ENABLE_OPENSSL OR ENABLE_OPENSSL_DYNAMIC))
|
||||||
|
add_compile_definitions(USE_BORINGSSL=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
set(KRB5_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/krb5/src")
|
set(KRB5_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/krb5/src")
|
||||||
set(KRB5_ET_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/include_private")
|
set(KRB5_ET_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/include_private")
|
||||||
|
|
||||||
@ -578,12 +582,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|||||||
list(APPEND ALL_SRCS "${CMAKE_CURRENT_BINARY_DIR}/include_private/kcmrpc.c")
|
list(APPEND ALL_SRCS "${CMAKE_CURRENT_BINARY_DIR}/include_private/kcmrpc.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_OPENSSL OR ENABLE_OPENSSL_DYNAMIC)
|
|
||||||
list(REMOVE_ITEM ALL_SRCS "${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/aes.c")
|
|
||||||
list(APPEND ALL_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/aes.c")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
|
||||||
target_sources(_krb5 PRIVATE
|
target_sources(_krb5 PRIVATE
|
||||||
${ALL_SRCS}
|
${ALL_SRCS}
|
||||||
)
|
)
|
||||||
|
@ -1,302 +0,0 @@
|
|||||||
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
||||||
/* lib/crypto/openssl/enc_provider/aes.c */
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2003, 2007, 2008, 2009 by the Massachusetts Institute of Technology.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Export of this software from the United States of America may
|
|
||||||
* require a specific license from the United States Government.
|
|
||||||
* It is the responsibility of any person or organization contemplating
|
|
||||||
* export to obtain such a license before exporting.
|
|
||||||
*
|
|
||||||
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
|
||||||
* distribute this software and its documentation for any purpose and
|
|
||||||
* without fee is hereby granted, provided that the above copyright
|
|
||||||
* notice appear in all copies and that both that copyright notice and
|
|
||||||
* this permission notice appear in supporting documentation, and that
|
|
||||||
* the name of M.I.T. not be used in advertising or publicity pertaining
|
|
||||||
* to distribution of the software without specific, written prior
|
|
||||||
* permission. Furthermore if you modify this software you must label
|
|
||||||
* your software as modified software and not distribute it in such a
|
|
||||||
* fashion that it might be confused with the original M.I.T. software.
|
|
||||||
* M.I.T. makes no representations about the suitability of
|
|
||||||
* this software for any purpose. It is provided "as is" without express
|
|
||||||
* or implied warranty.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "crypto_int.h"
|
|
||||||
#include <openssl/evp.h>
|
|
||||||
#include <openssl/aes.h>
|
|
||||||
|
|
||||||
/* proto's */
|
|
||||||
static krb5_error_code
|
|
||||||
cbc_enc(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data);
|
|
||||||
static krb5_error_code
|
|
||||||
cbc_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data);
|
|
||||||
static krb5_error_code
|
|
||||||
cts_encr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data, size_t dlen);
|
|
||||||
static krb5_error_code
|
|
||||||
cts_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data, size_t dlen);
|
|
||||||
|
|
||||||
#define BLOCK_SIZE 16
|
|
||||||
#define NUM_BITS 8
|
|
||||||
#define IV_CTS_BUF_SIZE 16 /* 16 - hardcoded in CRYPTO_cts128_en/decrypt */
|
|
||||||
|
|
||||||
static const EVP_CIPHER *
|
|
||||||
map_mode(unsigned int len)
|
|
||||||
{
|
|
||||||
if (len==16)
|
|
||||||
return EVP_aes_128_cbc();
|
|
||||||
if (len==32)
|
|
||||||
return EVP_aes_256_cbc();
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Encrypt one block using CBC. */
|
|
||||||
static krb5_error_code
|
|
||||||
cbc_enc(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data)
|
|
||||||
{
|
|
||||||
int ret, olen = BLOCK_SIZE;
|
|
||||||
unsigned char iblock[BLOCK_SIZE], oblock[BLOCK_SIZE];
|
|
||||||
EVP_CIPHER_CTX *ctx;
|
|
||||||
struct iov_cursor cursor;
|
|
||||||
|
|
||||||
ctx = EVP_CIPHER_CTX_new();
|
|
||||||
if (ctx == NULL)
|
|
||||||
return ENOMEM;
|
|
||||||
|
|
||||||
ret = EVP_EncryptInit_ex(ctx, map_mode(key->keyblock.length),
|
|
||||||
NULL, key->keyblock.contents, (ivec) ? (unsigned char*)ivec->data : NULL);
|
|
||||||
if (ret == 0) {
|
|
||||||
EVP_CIPHER_CTX_free(ctx);
|
|
||||||
return KRB5_CRYPTO_INTERNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
k5_iov_cursor_init(&cursor, data, num_data, BLOCK_SIZE, FALSE);
|
|
||||||
k5_iov_cursor_get(&cursor, iblock);
|
|
||||||
EVP_CIPHER_CTX_set_padding(ctx,0);
|
|
||||||
ret = EVP_EncryptUpdate(ctx, oblock, &olen, iblock, BLOCK_SIZE);
|
|
||||||
if (ret == 1)
|
|
||||||
k5_iov_cursor_put(&cursor, oblock);
|
|
||||||
EVP_CIPHER_CTX_free(ctx);
|
|
||||||
|
|
||||||
zap(iblock, BLOCK_SIZE);
|
|
||||||
zap(oblock, BLOCK_SIZE);
|
|
||||||
return (ret == 1) ? 0 : KRB5_CRYPTO_INTERNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Decrypt one block using CBC. */
|
|
||||||
static krb5_error_code
|
|
||||||
cbc_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data)
|
|
||||||
{
|
|
||||||
int ret = 0, olen = BLOCK_SIZE;
|
|
||||||
unsigned char iblock[BLOCK_SIZE], oblock[BLOCK_SIZE];
|
|
||||||
EVP_CIPHER_CTX *ctx;
|
|
||||||
struct iov_cursor cursor;
|
|
||||||
|
|
||||||
ctx = EVP_CIPHER_CTX_new();
|
|
||||||
if (ctx == NULL)
|
|
||||||
return ENOMEM;
|
|
||||||
|
|
||||||
ret = EVP_DecryptInit_ex(ctx, map_mode(key->keyblock.length),
|
|
||||||
NULL, key->keyblock.contents, (ivec) ? (unsigned char*)ivec->data : NULL);
|
|
||||||
if (ret == 0) {
|
|
||||||
EVP_CIPHER_CTX_free(ctx);
|
|
||||||
return KRB5_CRYPTO_INTERNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
k5_iov_cursor_init(&cursor, data, num_data, BLOCK_SIZE, FALSE);
|
|
||||||
k5_iov_cursor_get(&cursor, iblock);
|
|
||||||
EVP_CIPHER_CTX_set_padding(ctx,0);
|
|
||||||
ret = EVP_DecryptUpdate(ctx, oblock, &olen, iblock, BLOCK_SIZE);
|
|
||||||
if (ret == 1)
|
|
||||||
k5_iov_cursor_put(&cursor, oblock);
|
|
||||||
EVP_CIPHER_CTX_free(ctx);
|
|
||||||
|
|
||||||
zap(iblock, BLOCK_SIZE);
|
|
||||||
zap(oblock, BLOCK_SIZE);
|
|
||||||
return (ret == 1) ? 0 : KRB5_CRYPTO_INTERNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static krb5_error_code
|
|
||||||
cts_encr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data, size_t dlen)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
size_t size = 0;
|
|
||||||
unsigned char *oblock = NULL, *dbuf = NULL;
|
|
||||||
unsigned char iv_cts[IV_CTS_BUF_SIZE];
|
|
||||||
struct iov_cursor cursor;
|
|
||||||
AES_KEY enck;
|
|
||||||
|
|
||||||
memset(iv_cts,0,sizeof(iv_cts));
|
|
||||||
if (ivec && ivec->data){
|
|
||||||
if (ivec->length != sizeof(iv_cts))
|
|
||||||
return KRB5_CRYPTO_INTERNAL;
|
|
||||||
memcpy(iv_cts, ivec->data,ivec->length);
|
|
||||||
}
|
|
||||||
|
|
||||||
oblock = OPENSSL_malloc(dlen);
|
|
||||||
if (!oblock){
|
|
||||||
return ENOMEM;
|
|
||||||
}
|
|
||||||
dbuf = OPENSSL_malloc(dlen);
|
|
||||||
if (!dbuf){
|
|
||||||
OPENSSL_free(oblock);
|
|
||||||
return ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
k5_iov_cursor_init(&cursor, data, num_data, dlen, FALSE);
|
|
||||||
k5_iov_cursor_get(&cursor, dbuf);
|
|
||||||
|
|
||||||
AES_set_encrypt_key(key->keyblock.contents,
|
|
||||||
NUM_BITS * key->keyblock.length, &enck);
|
|
||||||
|
|
||||||
size = CRYPTO_cts128_encrypt((unsigned char *)dbuf, oblock, dlen, &enck,
|
|
||||||
iv_cts, AES_cbc_encrypt);
|
|
||||||
if (size <= 0)
|
|
||||||
ret = KRB5_CRYPTO_INTERNAL;
|
|
||||||
else
|
|
||||||
k5_iov_cursor_put(&cursor, oblock);
|
|
||||||
|
|
||||||
if (!ret && ivec && ivec->data)
|
|
||||||
memcpy(ivec->data, iv_cts, sizeof(iv_cts));
|
|
||||||
|
|
||||||
zap(oblock, dlen);
|
|
||||||
zap(dbuf, dlen);
|
|
||||||
OPENSSL_free(oblock);
|
|
||||||
OPENSSL_free(dbuf);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static krb5_error_code
|
|
||||||
cts_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
|
|
||||||
size_t num_data, size_t dlen)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
size_t size = 0;
|
|
||||||
unsigned char *oblock = NULL;
|
|
||||||
unsigned char *dbuf = NULL;
|
|
||||||
unsigned char iv_cts[IV_CTS_BUF_SIZE];
|
|
||||||
struct iov_cursor cursor;
|
|
||||||
AES_KEY deck;
|
|
||||||
|
|
||||||
memset(iv_cts,0,sizeof(iv_cts));
|
|
||||||
if (ivec && ivec->data){
|
|
||||||
if (ivec->length != sizeof(iv_cts))
|
|
||||||
return KRB5_CRYPTO_INTERNAL;
|
|
||||||
memcpy(iv_cts, ivec->data,ivec->length);
|
|
||||||
}
|
|
||||||
|
|
||||||
oblock = OPENSSL_malloc(dlen);
|
|
||||||
if (!oblock)
|
|
||||||
return ENOMEM;
|
|
||||||
dbuf = OPENSSL_malloc(dlen);
|
|
||||||
if (!dbuf){
|
|
||||||
OPENSSL_free(oblock);
|
|
||||||
return ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
AES_set_decrypt_key(key->keyblock.contents,
|
|
||||||
NUM_BITS * key->keyblock.length, &deck);
|
|
||||||
|
|
||||||
k5_iov_cursor_init(&cursor, data, num_data, dlen, FALSE);
|
|
||||||
k5_iov_cursor_get(&cursor, dbuf);
|
|
||||||
|
|
||||||
size = CRYPTO_cts128_decrypt((unsigned char *)dbuf, oblock,
|
|
||||||
dlen, &deck,
|
|
||||||
iv_cts, AES_cbc_encrypt);
|
|
||||||
if (size <= 0)
|
|
||||||
ret = KRB5_CRYPTO_INTERNAL;
|
|
||||||
else
|
|
||||||
k5_iov_cursor_put(&cursor, oblock);
|
|
||||||
|
|
||||||
if (!ret && ivec && ivec->data)
|
|
||||||
memcpy(ivec->data, iv_cts, sizeof(iv_cts));
|
|
||||||
|
|
||||||
zap(oblock, dlen);
|
|
||||||
zap(dbuf, dlen);
|
|
||||||
OPENSSL_free(oblock);
|
|
||||||
OPENSSL_free(dbuf);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
krb5_error_code
|
|
||||||
krb5int_aes_encrypt(krb5_key key, const krb5_data *ivec,
|
|
||||||
krb5_crypto_iov *data, size_t num_data)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
size_t input_length, nblocks;
|
|
||||||
|
|
||||||
input_length = iov_total_length(data, num_data, FALSE);
|
|
||||||
nblocks = (input_length + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
|
||||||
if (nblocks == 1) {
|
|
||||||
if (input_length != BLOCK_SIZE)
|
|
||||||
return KRB5_BAD_MSIZE;
|
|
||||||
ret = cbc_enc(key, ivec, data, num_data);
|
|
||||||
} else if (nblocks > 1) {
|
|
||||||
ret = cts_encr(key, ivec, data, num_data, input_length);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
krb5_error_code
|
|
||||||
krb5int_aes_decrypt(krb5_key key, const krb5_data *ivec,
|
|
||||||
krb5_crypto_iov *data, size_t num_data)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
size_t input_length, nblocks;
|
|
||||||
|
|
||||||
input_length = iov_total_length(data, num_data, FALSE);
|
|
||||||
nblocks = (input_length + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
|
||||||
if (nblocks == 1) {
|
|
||||||
if (input_length != BLOCK_SIZE)
|
|
||||||
return KRB5_BAD_MSIZE;
|
|
||||||
ret = cbc_decr(key, ivec, data, num_data);
|
|
||||||
} else if (nblocks > 1) {
|
|
||||||
ret = cts_decr(key, ivec, data, num_data, input_length);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static krb5_error_code
|
|
||||||
krb5int_aes_init_state (const krb5_keyblock *key, krb5_keyusage usage,
|
|
||||||
krb5_data *state)
|
|
||||||
{
|
|
||||||
state->length = 16;
|
|
||||||
state->data = (void *) malloc(16);
|
|
||||||
if (state->data == NULL)
|
|
||||||
return ENOMEM;
|
|
||||||
memset(state->data, 0, state->length);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
const struct krb5_enc_provider krb5int_enc_aes128 = {
|
|
||||||
16,
|
|
||||||
16, 16,
|
|
||||||
krb5int_aes_encrypt,
|
|
||||||
krb5int_aes_decrypt,
|
|
||||||
NULL,
|
|
||||||
krb5int_aes_init_state,
|
|
||||||
krb5int_default_free_state
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct krb5_enc_provider krb5int_enc_aes256 = {
|
|
||||||
16,
|
|
||||||
32, 32,
|
|
||||||
krb5int_aes_encrypt,
|
|
||||||
krb5int_aes_decrypt,
|
|
||||||
NULL,
|
|
||||||
krb5int_aes_init_state,
|
|
||||||
krb5int_default_free_state
|
|
||||||
};
|
|
@ -1,3 +1,9 @@
|
|||||||
|
# Note: ClickHouse uses BoringSSL. The presence of OpenSSL is only due to IBM's port of ClickHouse to s390x. BoringSSL does not support
|
||||||
|
# s390x, also FIPS validation provided by the OS vendor (Red Hat, Ubuntu) requires (preferrably dynamic) linking with OS packages which
|
||||||
|
# ClickHouse generally avoids.
|
||||||
|
#
|
||||||
|
# Furthermore, the in-source OpenSSL dump in this directory is due to development purposes and non FIPS-compliant.
|
||||||
|
|
||||||
if(ENABLE_OPENSSL_DYNAMIC OR ENABLE_OPENSSL)
|
if(ENABLE_OPENSSL_DYNAMIC OR ENABLE_OPENSSL)
|
||||||
set(ENABLE_SSL 1 CACHE INTERNAL "")
|
set(ENABLE_SSL 1 CACHE INTERNAL "")
|
||||||
set(OPENSSL_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/openssl)
|
set(OPENSSL_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/openssl)
|
||||||
|
@ -45,37 +45,38 @@ SELECT halfMD5(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')
|
|||||||
|
|
||||||
Calculates the MD4 from a string and returns the resulting set of bytes as FixedString(16).
|
Calculates the MD4 from a string and returns the resulting set of bytes as FixedString(16).
|
||||||
|
|
||||||
## MD5
|
## MD5 {#hash_functions-md5}
|
||||||
|
|
||||||
Calculates the MD5 from a string and returns the resulting set of bytes as FixedString(16).
|
Calculates the MD5 from a string and returns the resulting set of bytes as FixedString(16).
|
||||||
If you do not need MD5 in particular, but you need a decent cryptographic 128-bit hash, use the ‘sipHash128’ function instead.
|
If you do not need MD5 in particular, but you need a decent cryptographic 128-bit hash, use the ‘sipHash128’ function instead.
|
||||||
If you want to get the same result as output by the md5sum utility, use lower(hex(MD5(s))).
|
If you want to get the same result as output by the md5sum utility, use lower(hex(MD5(s))).
|
||||||
|
|
||||||
## sipHash64
|
## sipHash64 (#hash_functions-siphash64)
|
||||||
|
|
||||||
Produces a 64-bit [SipHash](https://131002.net/siphash/) hash value.
|
Produces a 64-bit [SipHash](https://en.wikipedia.org/wiki/SipHash) hash value.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
sipHash64(par1,...)
|
sipHash64(par1,...)
|
||||||
```
|
```
|
||||||
|
|
||||||
This is a cryptographic hash function. It works at least three times faster than the [MD5](#hash_functions-md5) function.
|
This is a cryptographic hash function. It works at least three times faster than the [MD5](#hash_functions-md5) hash function.
|
||||||
|
|
||||||
Function [interprets](/docs/en/sql-reference/functions/type-conversion-functions.md/#type_conversion_functions-reinterpretAsString) all the input parameters as strings and calculates the hash value for each of them. Then combines hashes by the following algorithm:
|
The function [interprets](/docs/en/sql-reference/functions/type-conversion-functions.md/#type_conversion_functions-reinterpretAsString) all the input parameters as strings and calculates the hash value for each of them. It then combines the hashes by the following algorithm:
|
||||||
|
|
||||||
1. After hashing all the input parameters, the function gets the array of hashes.
|
1. The first and the second hash value are concatenated to an array which is hashed.
|
||||||
2. Function takes the first and the second elements and calculates a hash for the array of them.
|
2. The previously calculated hash value and the hash of the third input paramter are hashed in a similar way.
|
||||||
3. Then the function takes the hash value, calculated at the previous step, and the third element of the initial hash array, and calculates a hash for the array of them.
|
3. This calculation is repeated for all remaining hash values of the original input.
|
||||||
4. The previous step is repeated for all the remaining elements of the initial hash array.
|
|
||||||
|
|
||||||
**Arguments**
|
**Arguments**
|
||||||
|
|
||||||
The function takes a variable number of input parameters. Arguments can be any of the [supported data types](/docs/en/sql-reference/data-types/index.md). For some data types calculated value of hash function may be the same for the same values even if types of arguments differ (integers of different size, named and unnamed `Tuple` with the same data, `Map` and the corresponding `Array(Tuple(key, value))` type with the same data).
|
The function takes a variable number of input parameters of any of the [supported data types](/docs/en/sql-reference/data-types/index.md).
|
||||||
|
|
||||||
**Returned Value**
|
**Returned Value**
|
||||||
|
|
||||||
A [UInt64](/docs/en/sql-reference/data-types/int-uint.md) data type hash value.
|
A [UInt64](/docs/en/sql-reference/data-types/int-uint.md) data type hash value.
|
||||||
|
|
||||||
|
Note that the calculated hash values may be equal for the same input values of different argument types. This affects for example integer types of different size, named and unnamed `Tuple` with the same data, `Map` and the corresponding `Array(Tuple(key, value))` type with the same data.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
@ -84,13 +85,45 @@ SELECT sipHash64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00
|
|||||||
|
|
||||||
```response
|
```response
|
||||||
┌──────────────SipHash─┬─type───┐
|
┌──────────────SipHash─┬─type───┐
|
||||||
│ 13726873534472839665 │ UInt64 │
|
│ 11400366955626497465 │ UInt64 │
|
||||||
└──────────────────────┴────────┘
|
└──────────────────────┴────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## sipHash64Keyed
|
||||||
|
|
||||||
|
Same as [sipHash64](#hash_functions-siphash64) but additionally takes an explicit key argument instead of using a fixed key.
|
||||||
|
|
||||||
|
**Syntax**
|
||||||
|
|
||||||
|
```sql
|
||||||
|
sipHash64Keyed((k0, k1), par1,...)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Arguments**
|
||||||
|
|
||||||
|
Same as [sipHash64](#hash_functions-siphash64), but the first argument is a tuple of two UInt64 values representing the key.
|
||||||
|
|
||||||
|
**Returned value**
|
||||||
|
|
||||||
|
A [UInt64](/docs/en/sql-reference/data-types/int-uint.md) data type hash value.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
Query:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT sipHash64Keyed((506097522914230528, 1084818905618843912), array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:00:00')) AS SipHash, toTypeName(SipHash) AS type;
|
||||||
|
```
|
||||||
|
|
||||||
|
```response
|
||||||
|
┌─────────────SipHash─┬─type───┐
|
||||||
|
│ 8017656310194184311 │ UInt64 │
|
||||||
|
└─────────────────────┴────────┘
|
||||||
|
```
|
||||||
|
|
||||||
## sipHash128
|
## sipHash128
|
||||||
|
|
||||||
Produces a 128-bit [SipHash](https://131002.net/siphash/) hash value. Differs from [sipHash64](#hash_functions-siphash64) in that the final xor-folding state is done up to 128 bits.
|
Like [sipHash64](#hash_functions-siphash64) but produces a 128-bit hash value, i.e. the final xor-folding state is done up to 128 bits.
|
||||||
|
|
||||||
**Syntax**
|
**Syntax**
|
||||||
|
|
||||||
@ -100,13 +133,11 @@ sipHash128(par1,...)
|
|||||||
|
|
||||||
**Arguments**
|
**Arguments**
|
||||||
|
|
||||||
The function takes a variable number of input parameters. Arguments can be any of the [supported data types](/docs/en/sql-reference/data-types/index.md). For some data types calculated value of hash function may be the same for the same values even if types of arguments differ (integers of different size, named and unnamed `Tuple` with the same data, `Map` and the corresponding `Array(Tuple(key, value))` type with the same data).
|
Same as for [sipHash64](#hash_functions-siphash64).
|
||||||
|
|
||||||
**Returned value**
|
**Returned value**
|
||||||
|
|
||||||
A 128-bit `SipHash` hash value.
|
A 128-bit `SipHash` hash value of type [FixedString(16)](/docs/en/sql-reference/data-types/fixedstring.md).
|
||||||
|
|
||||||
Type: [FixedString(16)](/docs/en/sql-reference/data-types/fixedstring.md).
|
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
@ -124,6 +155,40 @@ Result:
|
|||||||
└──────────────────────────────────┘
|
└──────────────────────────────────┘
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## sipHash128Keyed
|
||||||
|
|
||||||
|
Same as [sipHash128](#hash_functions-siphash128) but additionally takes an explicit key argument instead of using a fixed key.
|
||||||
|
|
||||||
|
**Syntax**
|
||||||
|
|
||||||
|
```sql
|
||||||
|
sipHash128Keyed((k0, k1), par1,...)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Arguments**
|
||||||
|
|
||||||
|
Same as [sipHash128](#hash_functions-siphash128), but the first argument is a tuple of two UInt64 values representing the key.
|
||||||
|
|
||||||
|
**Returned value**
|
||||||
|
|
||||||
|
A [UInt64](/docs/en/sql-reference/data-types/int-uint.md) data type hash value.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
Query:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT hex(sipHash128Keyed((506097522914230528, 1084818905618843912),'foo', '\x01', 3));
|
||||||
|
```
|
||||||
|
|
||||||
|
Result:
|
||||||
|
|
||||||
|
```response
|
||||||
|
┌─hex(sipHash128Keyed((506097522914230528, 1084818905618843912), 'foo', '', 3))─┐
|
||||||
|
│ B8467F65C8B4CFD9A5F8BD733917D9BF │
|
||||||
|
└───────────────────────────────────────────────────────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
## cityHash64
|
## cityHash64
|
||||||
|
|
||||||
Produces a 64-bit [CityHash](https://github.com/google/cityhash) hash value.
|
Produces a 64-bit [CityHash](https://github.com/google/cityhash) hash value.
|
||||||
|
@ -78,13 +78,13 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// Arguments - seed.
|
/// Arguments - seed.
|
||||||
SipHash(UInt64 k0 = 0, UInt64 k1 = 0) /// NOLINT
|
SipHash(UInt64 key0 = 0, UInt64 key1 = 0) /// NOLINT
|
||||||
{
|
{
|
||||||
/// Initialize the state with some random bytes and seed.
|
/// Initialize the state with some random bytes and seed.
|
||||||
v0 = 0x736f6d6570736575ULL ^ k0;
|
v0 = 0x736f6d6570736575ULL ^ key0;
|
||||||
v1 = 0x646f72616e646f6dULL ^ k1;
|
v1 = 0x646f72616e646f6dULL ^ key1;
|
||||||
v2 = 0x6c7967656e657261ULL ^ k0;
|
v2 = 0x6c7967656e657261ULL ^ key0;
|
||||||
v3 = 0x7465646279746573ULL ^ k1;
|
v3 = 0x7465646279746573ULL ^ key1;
|
||||||
|
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
current_word = 0;
|
current_word = 0;
|
||||||
@ -216,20 +216,30 @@ inline void sipHash128(const char * data, const size_t size, char * out)
|
|||||||
hash.get128(out);
|
hash.get128(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline UInt128 sipHash128(const char * data, const size_t size)
|
inline UInt128 sipHash128Keyed(UInt64 key0, UInt64 key1, const char * data, const size_t size)
|
||||||
{
|
{
|
||||||
SipHash hash;
|
SipHash hash(key0, key1);
|
||||||
hash.update(data, size);
|
hash.update(data, size);
|
||||||
return hash.get128();
|
return hash.get128();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline UInt64 sipHash64(const char * data, const size_t size)
|
inline UInt128 sipHash128(const char * data, const size_t size)
|
||||||
{
|
{
|
||||||
SipHash hash;
|
return sipHash128Keyed(0, 0, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline UInt64 sipHash64Keyed(UInt64 key0, UInt64 key1, const char * data, const size_t size)
|
||||||
|
{
|
||||||
|
SipHash hash(key0, key1);
|
||||||
hash.update(data, size);
|
hash.update(data, size);
|
||||||
return hash.get64();
|
return hash.get64();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline UInt64 sipHash64(const char * data, const size_t size)
|
||||||
|
{
|
||||||
|
return sipHash64Keyed(0, 0, data, size);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
UInt64 sipHash64(const T & x)
|
UInt64 sipHash64(const T & x)
|
||||||
{
|
{
|
||||||
|
54
src/Common/shuffle.h
Normal file
54
src/Common/shuffle.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
|
#include <random>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
/* Reorders the elements in the given range [first, last) such that each
|
||||||
|
* possible permutation of those elements has equal probability of appearance.
|
||||||
|
*
|
||||||
|
* for i ∈ [0, n-2):
|
||||||
|
* j ← random from ∈ [i, n)
|
||||||
|
* swap arr[i] ↔ arr[j]
|
||||||
|
*/
|
||||||
|
template <typename Iter, typename Rng>
|
||||||
|
void shuffle(Iter first, Iter last, Rng && rng)
|
||||||
|
{
|
||||||
|
using diff_t = typename std::iterator_traits<Iter>::difference_type;
|
||||||
|
using distr_t = std::uniform_int_distribution<diff_t>;
|
||||||
|
using param_t = typename distr_t::param_type;
|
||||||
|
distr_t d;
|
||||||
|
diff_t n = last - first;
|
||||||
|
for (ssize_t i = 0; i < n - 1; ++i)
|
||||||
|
{
|
||||||
|
using std::swap;
|
||||||
|
auto j = d(rng, param_t(i, n - 1));
|
||||||
|
swap(first[i], first[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Partially shuffle elements in range [first, last) in such a way that
|
||||||
|
* [first, first + limit) is a random subset of the original range.
|
||||||
|
* [first + limit, last) shall contain the elements not in [first, first + limit)
|
||||||
|
* in undefined order.
|
||||||
|
*
|
||||||
|
* for i ∈ [0, limit):
|
||||||
|
* j ← random from ∈ [i, n)
|
||||||
|
* swap arr[i] ↔ arr[j]
|
||||||
|
*/
|
||||||
|
template <typename Iter, typename Rng>
|
||||||
|
void partial_shuffle(Iter first, Iter last, size_t limit, Rng && rng)
|
||||||
|
{
|
||||||
|
using diff_t = typename std::iterator_traits<Iter>::difference_type;
|
||||||
|
using distr_t = std::uniform_int_distribution<diff_t>;
|
||||||
|
using param_t = typename distr_t::param_type;
|
||||||
|
distr_t d;
|
||||||
|
diff_t n = last - first;
|
||||||
|
for (size_t i = 0; i < limit; ++i)
|
||||||
|
{
|
||||||
|
using std::swap;
|
||||||
|
auto j = d(rng, param_t(i, n - 1));
|
||||||
|
swap(first[i], first[j]);
|
||||||
|
}
|
||||||
|
}
|
@ -71,6 +71,38 @@ namespace ErrorCodes
|
|||||||
extern const int SUPPORT_IS_DISABLED;
|
extern const int SUPPORT_IS_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace impl
|
||||||
|
{
|
||||||
|
struct SipHashKey
|
||||||
|
{
|
||||||
|
UInt64 key0 = 0;
|
||||||
|
UInt64 key1 = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
static SipHashKey parseSipHashKey(const ColumnWithTypeAndName & key)
|
||||||
|
{
|
||||||
|
SipHashKey ret;
|
||||||
|
|
||||||
|
const auto * tuple = checkAndGetColumn<ColumnTuple>(key.column.get());
|
||||||
|
if (!tuple)
|
||||||
|
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "key must be a tuple");
|
||||||
|
|
||||||
|
if (tuple->tupleSize() != 2)
|
||||||
|
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "wrong tuple size: key must be a tuple of 2 UInt64");
|
||||||
|
|
||||||
|
if (const auto * key0col = checkAndGetColumn<ColumnUInt64>(&(tuple->getColumn(0))))
|
||||||
|
ret.key0 = key0col->get64(0);
|
||||||
|
else
|
||||||
|
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "first element of the key tuple is not UInt64");
|
||||||
|
|
||||||
|
if (const auto * key1col = checkAndGetColumn<ColumnUInt64>(&(tuple->getColumn(1))))
|
||||||
|
ret.key1 = key1col->get64(0);
|
||||||
|
else
|
||||||
|
throw Exception(ErrorCodes::NOT_IMPLEMENTED, "second element of the key tuple is not UInt64");
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Hashing functions.
|
/** Hashing functions.
|
||||||
*
|
*
|
||||||
@ -274,6 +306,25 @@ struct SipHash64Impl
|
|||||||
static constexpr bool use_int_hash_for_pods = false;
|
static constexpr bool use_int_hash_for_pods = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct SipHash64KeyedImpl
|
||||||
|
{
|
||||||
|
static constexpr auto name = "sipHash64Keyed";
|
||||||
|
using ReturnType = UInt64;
|
||||||
|
using Key = impl::SipHashKey;
|
||||||
|
|
||||||
|
static Key parseKey(const ColumnWithTypeAndName & key) { return impl::parseSipHashKey(key); }
|
||||||
|
|
||||||
|
static UInt64 applyKeyed(const Key & key, const char * begin, size_t size) { return sipHash64Keyed(key.key0, key.key1, begin, size); }
|
||||||
|
|
||||||
|
static UInt64 combineHashesKeyed(const Key & key, UInt64 h1, UInt64 h2)
|
||||||
|
{
|
||||||
|
UInt64 hashes[] = {h1, h2};
|
||||||
|
return applyKeyed(key, reinterpret_cast<const char *>(hashes), 2 * sizeof(UInt64));
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr bool use_int_hash_for_pods = false;
|
||||||
|
};
|
||||||
|
|
||||||
struct SipHash128Impl
|
struct SipHash128Impl
|
||||||
{
|
{
|
||||||
static constexpr auto name = "sipHash128";
|
static constexpr auto name = "sipHash128";
|
||||||
@ -293,6 +344,25 @@ struct SipHash128Impl
|
|||||||
static constexpr bool use_int_hash_for_pods = false;
|
static constexpr bool use_int_hash_for_pods = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct SipHash128KeyedImpl
|
||||||
|
{
|
||||||
|
static constexpr auto name = "sipHash128Keyed";
|
||||||
|
using ReturnType = UInt128;
|
||||||
|
using Key = impl::SipHashKey;
|
||||||
|
|
||||||
|
static Key parseKey(const ColumnWithTypeAndName & key) { return impl::parseSipHashKey(key); }
|
||||||
|
|
||||||
|
static UInt128 applyKeyed(const Key & key, const char * begin, size_t size) { return sipHash128Keyed(key.key0, key.key1, begin, size); }
|
||||||
|
|
||||||
|
static UInt128 combineHashesKeyed(const Key & key, UInt128 h1, UInt128 h2)
|
||||||
|
{
|
||||||
|
UInt128 hashes[] = {h1, h2};
|
||||||
|
return applyKeyed(key, reinterpret_cast<const char *>(hashes), 2 * sizeof(UInt128));
|
||||||
|
}
|
||||||
|
|
||||||
|
static constexpr bool use_int_hash_for_pods = false;
|
||||||
|
};
|
||||||
|
|
||||||
/** Why we need MurmurHash2?
|
/** Why we need MurmurHash2?
|
||||||
* MurmurHash2 is an outdated hash function, superseded by MurmurHash3 and subsequently by CityHash, xxHash, HighwayHash.
|
* MurmurHash2 is an outdated hash function, superseded by MurmurHash3 and subsequently by CityHash, xxHash, HighwayHash.
|
||||||
* Usually there is no reason to use MurmurHash.
|
* Usually there is no reason to use MurmurHash.
|
||||||
@ -896,7 +966,7 @@ private:
|
|||||||
|
|
||||||
DECLARE_MULTITARGET_CODE(
|
DECLARE_MULTITARGET_CODE(
|
||||||
|
|
||||||
template <typename Impl>
|
template <typename Impl, bool Keyed, typename KeyType>
|
||||||
class FunctionAnyHash : public IFunction
|
class FunctionAnyHash : public IFunction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -906,7 +976,7 @@ private:
|
|||||||
using ToType = typename Impl::ReturnType;
|
using ToType = typename Impl::ReturnType;
|
||||||
|
|
||||||
template <typename FromType, bool first>
|
template <typename FromType, bool first>
|
||||||
void executeIntType(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeIntType(const KeyType & key, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
using ColVecType = ColumnVectorOrDecimal<FromType>;
|
using ColVecType = ColumnVectorOrDecimal<FromType>;
|
||||||
|
|
||||||
@ -930,13 +1000,13 @@ private:
|
|||||||
if (std::is_same_v<Impl, JavaHashImpl>)
|
if (std::is_same_v<Impl, JavaHashImpl>)
|
||||||
h = JavaHashImpl::apply(vec_from[i]);
|
h = JavaHashImpl::apply(vec_from[i]);
|
||||||
else
|
else
|
||||||
h = Impl::apply(reinterpret_cast<const char *>(&vec_from[i]), sizeof(vec_from[i]));
|
h = apply(key, reinterpret_cast<const char *>(&vec_from[i]), sizeof(vec_from[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (auto col_from_const = checkAndGetColumnConst<ColVecType>(column))
|
else if (auto col_from_const = checkAndGetColumnConst<ColVecType>(column))
|
||||||
@ -956,7 +1026,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], hash);
|
vec_to[i] = combineHashes(key, vec_to[i], hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -965,7 +1035,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename FromType, bool first>
|
template <typename FromType, bool first>
|
||||||
void executeBigIntType(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeBigIntType(const KeyType & key, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
using ColVecType = ColumnVectorOrDecimal<FromType>;
|
using ColVecType = ColumnVectorOrDecimal<FromType>;
|
||||||
|
|
||||||
@ -975,19 +1045,19 @@ private:
|
|||||||
size_t size = vec_from.size();
|
size_t size = vec_from.size();
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
ToType h = Impl::apply(reinterpret_cast<const char *>(&vec_from[i]), sizeof(vec_from[i]));
|
ToType h = apply(key, reinterpret_cast<const char *>(&vec_from[i]), sizeof(vec_from[i]));
|
||||||
|
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (auto col_from_const = checkAndGetColumnConst<ColVecType>(column))
|
else if (auto col_from_const = checkAndGetColumnConst<ColVecType>(column))
|
||||||
{
|
{
|
||||||
auto value = col_from_const->template getValue<FromType>();
|
auto value = col_from_const->template getValue<FromType>();
|
||||||
|
|
||||||
ToType h = Impl::apply(reinterpret_cast<const char *>(&value), sizeof(value));
|
ToType h = apply(key, reinterpret_cast<const char *>(&value), sizeof(value));
|
||||||
|
|
||||||
size_t size = vec_to.size();
|
size_t size = vec_to.size();
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
@ -997,7 +1067,7 @@ private:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1006,21 +1076,21 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <bool first>
|
template <bool first>
|
||||||
void executeGeneric(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeGeneric(const KeyType & key, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
for (size_t i = 0, size = column->size(); i < size; ++i)
|
for (size_t i = 0, size = column->size(); i < size; ++i)
|
||||||
{
|
{
|
||||||
StringRef bytes = column->getDataAt(i);
|
StringRef bytes = column->getDataAt(i);
|
||||||
const ToType h = Impl::apply(bytes.data, bytes.size);
|
const ToType h = apply(key, bytes.data, bytes.size);
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool first>
|
template <bool first>
|
||||||
void executeString(const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeString(const KeyType & key, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
if (const ColumnString * col_from = checkAndGetColumn<ColumnString>(column))
|
if (const ColumnString * col_from = checkAndGetColumn<ColumnString>(column))
|
||||||
{
|
{
|
||||||
@ -1031,14 +1101,14 @@ private:
|
|||||||
ColumnString::Offset current_offset = 0;
|
ColumnString::Offset current_offset = 0;
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
const ToType h = Impl::apply(
|
const ToType h = apply(key,
|
||||||
reinterpret_cast<const char *>(&data[current_offset]),
|
reinterpret_cast<const char *>(&data[current_offset]),
|
||||||
offsets[i] - current_offset - 1);
|
offsets[i] - current_offset - 1);
|
||||||
|
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
|
|
||||||
current_offset = offsets[i];
|
current_offset = offsets[i];
|
||||||
}
|
}
|
||||||
@ -1051,17 +1121,17 @@ private:
|
|||||||
|
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
const ToType h = Impl::apply(reinterpret_cast<const char *>(&data[i * n]), n);
|
const ToType h = apply(key, reinterpret_cast<const char *>(&data[i * n]), n);
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (const ColumnConst * col_from_const = checkAndGetColumnConstStringOrFixedString(column))
|
else if (const ColumnConst * col_from_const = checkAndGetColumnConstStringOrFixedString(column))
|
||||||
{
|
{
|
||||||
String value = col_from_const->getValue<String>();
|
String value = col_from_const->getValue<String>();
|
||||||
const ToType hash = Impl::apply(value.data(), value.size());
|
const ToType hash = apply(key, value.data(), value.size());
|
||||||
const size_t size = vec_to.size();
|
const size_t size = vec_to.size();
|
||||||
|
|
||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
@ -1072,7 +1142,7 @@ private:
|
|||||||
{
|
{
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < size; ++i)
|
||||||
{
|
{
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], hash);
|
vec_to[i] = combineHashes(key, vec_to[i], hash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1082,7 +1152,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <bool first>
|
template <bool first>
|
||||||
void executeArray(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeArray(const KeyType & key, const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
const IDataType * nested_type = typeid_cast<const DataTypeArray *>(type)->getNestedType().get();
|
const IDataType * nested_type = typeid_cast<const DataTypeArray *>(type)->getNestedType().get();
|
||||||
|
|
||||||
@ -1094,7 +1164,7 @@ private:
|
|||||||
|
|
||||||
typename ColumnVector<ToType>::Container vec_temp(nested_size);
|
typename ColumnVector<ToType>::Container vec_temp(nested_size);
|
||||||
bool nested_is_first = true;
|
bool nested_is_first = true;
|
||||||
executeForArgument(nested_type, nested_column, vec_temp, nested_is_first);
|
executeForArgument(key, nested_type, nested_column, vec_temp, nested_is_first);
|
||||||
|
|
||||||
const size_t size = offsets.size();
|
const size_t size = offsets.size();
|
||||||
|
|
||||||
@ -1112,10 +1182,10 @@ private:
|
|||||||
if constexpr (first)
|
if constexpr (first)
|
||||||
vec_to[i] = h;
|
vec_to[i] = h;
|
||||||
else
|
else
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], h);
|
vec_to[i] = combineHashes(key, vec_to[i], h);
|
||||||
|
|
||||||
for (size_t j = current_offset; j < next_offset; ++j)
|
for (size_t j = current_offset; j < next_offset; ++j)
|
||||||
vec_to[i] = Impl::combineHashes(vec_to[i], vec_temp[j]);
|
vec_to[i] = combineHashes(key, vec_to[i], vec_temp[j]);
|
||||||
|
|
||||||
current_offset = offsets[i];
|
current_offset = offsets[i];
|
||||||
}
|
}
|
||||||
@ -1124,7 +1194,7 @@ private:
|
|||||||
{
|
{
|
||||||
/// NOTE: here, of course, you can do without the materialization of the column.
|
/// NOTE: here, of course, you can do without the materialization of the column.
|
||||||
ColumnPtr full_column = col_from_const->convertToFullColumn();
|
ColumnPtr full_column = col_from_const->convertToFullColumn();
|
||||||
executeArray<first>(type, &*full_column, vec_to);
|
executeArray<first>(key, type, &*full_column, vec_to);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Illegal column {} of first argument of function {}",
|
throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Illegal column {} of first argument of function {}",
|
||||||
@ -1132,44 +1202,44 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <bool first>
|
template <bool first>
|
||||||
void executeAny(const IDataType * from_type, const IColumn * icolumn, typename ColumnVector<ToType>::Container & vec_to) const
|
void executeAny(const KeyType & key, const IDataType * from_type, const IColumn * icolumn, typename ColumnVector<ToType>::Container & vec_to) const
|
||||||
{
|
{
|
||||||
WhichDataType which(from_type);
|
WhichDataType which(from_type);
|
||||||
|
|
||||||
if (which.isUInt8()) executeIntType<UInt8, first>(icolumn, vec_to);
|
if (which.isUInt8()) executeIntType<UInt8, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUInt16()) executeIntType<UInt16, first>(icolumn, vec_to);
|
else if (which.isUInt16()) executeIntType<UInt16, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUInt32()) executeIntType<UInt32, first>(icolumn, vec_to);
|
else if (which.isUInt32()) executeIntType<UInt32, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUInt64()) executeIntType<UInt64, first>(icolumn, vec_to);
|
else if (which.isUInt64()) executeIntType<UInt64, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUInt128()) executeBigIntType<UInt128, first>(icolumn, vec_to);
|
else if (which.isUInt128()) executeBigIntType<UInt128, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUInt256()) executeBigIntType<UInt256, first>(icolumn, vec_to);
|
else if (which.isUInt256()) executeBigIntType<UInt256, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt8()) executeIntType<Int8, first>(icolumn, vec_to);
|
else if (which.isInt8()) executeIntType<Int8, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt16()) executeIntType<Int16, first>(icolumn, vec_to);
|
else if (which.isInt16()) executeIntType<Int16, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt32()) executeIntType<Int32, first>(icolumn, vec_to);
|
else if (which.isInt32()) executeIntType<Int32, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt64()) executeIntType<Int64, first>(icolumn, vec_to);
|
else if (which.isInt64()) executeIntType<Int64, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt128()) executeBigIntType<Int128, first>(icolumn, vec_to);
|
else if (which.isInt128()) executeBigIntType<Int128, first>(key, icolumn, vec_to);
|
||||||
else if (which.isInt256()) executeBigIntType<Int256, first>(icolumn, vec_to);
|
else if (which.isInt256()) executeBigIntType<Int256, first>(key, icolumn, vec_to);
|
||||||
else if (which.isUUID()) executeBigIntType<UUID, first>(icolumn, vec_to);
|
else if (which.isUUID()) executeBigIntType<UUID, first>(key, icolumn, vec_to);
|
||||||
else if (which.isIPv4()) executeIntType<IPv4, first>(icolumn, vec_to);
|
else if (which.isIPv4()) executeIntType<IPv4, first>(key, icolumn, vec_to);
|
||||||
else if (which.isIPv6()) executeBigIntType<IPv6, first>(icolumn, vec_to);
|
else if (which.isIPv6()) executeBigIntType<IPv6, first>(key, icolumn, vec_to);
|
||||||
else if (which.isEnum8()) executeIntType<Int8, first>(icolumn, vec_to);
|
else if (which.isEnum8()) executeIntType<Int8, first>(key, icolumn, vec_to);
|
||||||
else if (which.isEnum16()) executeIntType<Int16, first>(icolumn, vec_to);
|
else if (which.isEnum16()) executeIntType<Int16, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDate()) executeIntType<UInt16, first>(icolumn, vec_to);
|
else if (which.isDate()) executeIntType<UInt16, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDate32()) executeIntType<Int32, first>(icolumn, vec_to);
|
else if (which.isDate32()) executeIntType<Int32, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDateTime()) executeIntType<UInt32, first>(icolumn, vec_to);
|
else if (which.isDateTime()) executeIntType<UInt32, first>(key, icolumn, vec_to);
|
||||||
/// TODO: executeIntType() for Decimal32/64 leads to incompatible result
|
/// TODO: executeIntType() for Decimal32/64 leads to incompatible result
|
||||||
else if (which.isDecimal32()) executeBigIntType<Decimal32, first>(icolumn, vec_to);
|
else if (which.isDecimal32()) executeBigIntType<Decimal32, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDecimal64()) executeBigIntType<Decimal64, first>(icolumn, vec_to);
|
else if (which.isDecimal64()) executeBigIntType<Decimal64, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDecimal128()) executeBigIntType<Decimal128, first>(icolumn, vec_to);
|
else if (which.isDecimal128()) executeBigIntType<Decimal128, first>(key, icolumn, vec_to);
|
||||||
else if (which.isDecimal256()) executeBigIntType<Decimal256, first>(icolumn, vec_to);
|
else if (which.isDecimal256()) executeBigIntType<Decimal256, first>(key, icolumn, vec_to);
|
||||||
else if (which.isFloat32()) executeIntType<Float32, first>(icolumn, vec_to);
|
else if (which.isFloat32()) executeIntType<Float32, first>(key, icolumn, vec_to);
|
||||||
else if (which.isFloat64()) executeIntType<Float64, first>(icolumn, vec_to);
|
else if (which.isFloat64()) executeIntType<Float64, first>(key, icolumn, vec_to);
|
||||||
else if (which.isString()) executeString<first>(icolumn, vec_to);
|
else if (which.isString()) executeString<first>(key, icolumn, vec_to);
|
||||||
else if (which.isFixedString()) executeString<first>(icolumn, vec_to);
|
else if (which.isFixedString()) executeString<first>(key, icolumn, vec_to);
|
||||||
else if (which.isArray()) executeArray<first>(from_type, icolumn, vec_to);
|
else if (which.isArray()) executeArray<first>(key, from_type, icolumn, vec_to);
|
||||||
else executeGeneric<first>(icolumn, vec_to);
|
else executeGeneric<first>(key, icolumn, vec_to);
|
||||||
}
|
}
|
||||||
|
|
||||||
void executeForArgument(const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to, bool & is_first) const
|
void executeForArgument(const KeyType & key, const IDataType * type, const IColumn * column, typename ColumnVector<ToType>::Container & vec_to, bool & is_first) const
|
||||||
{
|
{
|
||||||
/// Flattening of tuples.
|
/// Flattening of tuples.
|
||||||
if (const ColumnTuple * tuple = typeid_cast<const ColumnTuple *>(column))
|
if (const ColumnTuple * tuple = typeid_cast<const ColumnTuple *>(column))
|
||||||
@ -1178,7 +1248,7 @@ private:
|
|||||||
const DataTypes & tuple_types = typeid_cast<const DataTypeTuple &>(*type).getElements();
|
const DataTypes & tuple_types = typeid_cast<const DataTypeTuple &>(*type).getElements();
|
||||||
size_t tuple_size = tuple_columns.size();
|
size_t tuple_size = tuple_columns.size();
|
||||||
for (size_t i = 0; i < tuple_size; ++i)
|
for (size_t i = 0; i < tuple_size; ++i)
|
||||||
executeForArgument(tuple_types[i].get(), tuple_columns[i].get(), vec_to, is_first);
|
executeForArgument(key, tuple_types[i].get(), tuple_columns[i].get(), vec_to, is_first);
|
||||||
}
|
}
|
||||||
else if (const ColumnTuple * tuple_const = checkAndGetColumnConstData<ColumnTuple>(column))
|
else if (const ColumnTuple * tuple_const = checkAndGetColumnConstData<ColumnTuple>(column))
|
||||||
{
|
{
|
||||||
@ -1188,25 +1258,25 @@ private:
|
|||||||
for (size_t i = 0; i < tuple_size; ++i)
|
for (size_t i = 0; i < tuple_size; ++i)
|
||||||
{
|
{
|
||||||
auto tmp = ColumnConst::create(tuple_columns[i], column->size());
|
auto tmp = ColumnConst::create(tuple_columns[i], column->size());
|
||||||
executeForArgument(tuple_types[i].get(), tmp.get(), vec_to, is_first);
|
executeForArgument(key, tuple_types[i].get(), tmp.get(), vec_to, is_first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (const auto * map = checkAndGetColumn<ColumnMap>(column))
|
else if (const auto * map = checkAndGetColumn<ColumnMap>(column))
|
||||||
{
|
{
|
||||||
const auto & type_map = assert_cast<const DataTypeMap &>(*type);
|
const auto & type_map = assert_cast<const DataTypeMap &>(*type);
|
||||||
executeForArgument(type_map.getNestedType().get(), map->getNestedColumnPtr().get(), vec_to, is_first);
|
executeForArgument(key, type_map.getNestedType().get(), map->getNestedColumnPtr().get(), vec_to, is_first);
|
||||||
}
|
}
|
||||||
else if (const auto * const_map = checkAndGetColumnConstData<ColumnMap>(column))
|
else if (const auto * const_map = checkAndGetColumnConstData<ColumnMap>(column))
|
||||||
{
|
{
|
||||||
const auto & type_map = assert_cast<const DataTypeMap &>(*type);
|
const auto & type_map = assert_cast<const DataTypeMap &>(*type);
|
||||||
executeForArgument(type_map.getNestedType().get(), const_map->getNestedColumnPtr().get(), vec_to, is_first);
|
executeForArgument(key, type_map.getNestedType().get(), const_map->getNestedColumnPtr().get(), vec_to, is_first);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (is_first)
|
if (is_first)
|
||||||
executeAny<true>(type, column, vec_to);
|
executeAny<true>(key, type, column, vec_to);
|
||||||
else
|
else
|
||||||
executeAny<false>(type, column, vec_to);
|
executeAny<false>(key, type, column, vec_to);
|
||||||
}
|
}
|
||||||
|
|
||||||
is_first = false;
|
is_first = false;
|
||||||
@ -1240,17 +1310,29 @@ public:
|
|||||||
|
|
||||||
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
|
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
|
||||||
|
|
||||||
if (arguments.empty())
|
/// If using a "keyed" algorithm, the first argument is the key and
|
||||||
|
/// the data starts from the second argument.
|
||||||
|
/// Otherwise there is no key and all arguments are interpreted as data.
|
||||||
|
constexpr size_t first_data_argument = Keyed;
|
||||||
|
|
||||||
|
if (arguments.size() <= first_data_argument)
|
||||||
{
|
{
|
||||||
/// Constant random number from /dev/urandom is used as a hash value of empty list of arguments.
|
/// Return a fixed random-looking magic number when input is empty
|
||||||
vec_to.assign(rows, static_cast<ToType>(0xe28dbde7fe22e41c));
|
vec_to.assign(rows, static_cast<ToType>(0xe28dbde7fe22e41c));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The function supports arbitrary number of arguments of arbitrary types.
|
KeyType key{};
|
||||||
|
if constexpr (Keyed)
|
||||||
|
if (!arguments.empty())
|
||||||
|
key = Impl::parseKey(arguments[0]);
|
||||||
|
|
||||||
|
/// The function supports arbitrary number of arguments of arbitrary types.
|
||||||
bool is_first_argument = true;
|
bool is_first_argument = true;
|
||||||
for (const auto & col : arguments)
|
for (size_t i = first_data_argument; i < arguments.size(); ++i)
|
||||||
executeForArgument(col.type.get(), col.column.get(), vec_to, is_first_argument);
|
{
|
||||||
|
const auto & col = arguments[i];
|
||||||
|
executeForArgument(key, col.type.get(), col.column.get(), vec_to, is_first_argument);
|
||||||
|
}
|
||||||
|
|
||||||
if constexpr (std::is_same_v<ToType, UInt128>) /// backward-compatible
|
if constexpr (std::is_same_v<ToType, UInt128>) /// backward-compatible
|
||||||
{
|
{
|
||||||
@ -1261,25 +1343,38 @@ public:
|
|||||||
|
|
||||||
return col_to;
|
return col_to;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ToType apply(const KeyType & key, const char * begin, size_t size)
|
||||||
|
{
|
||||||
|
if constexpr (Keyed)
|
||||||
|
return Impl::applyKeyed(key, begin, size);
|
||||||
|
else
|
||||||
|
return Impl::apply(begin, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ToType combineHashes(const KeyType & key, ToType h1, ToType h2)
|
||||||
|
{
|
||||||
|
if constexpr (Keyed)
|
||||||
|
return Impl::combineHashesKeyed(key, h1, h2);
|
||||||
|
else
|
||||||
|
return Impl::combineHashes(h1, h2);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
) // DECLARE_MULTITARGET_CODE
|
) // DECLARE_MULTITARGET_CODE
|
||||||
|
|
||||||
template <typename Impl>
|
template <typename Impl, bool Keyed = false, typename KeyType = char>
|
||||||
class FunctionAnyHash : public TargetSpecific::Default::FunctionAnyHash<Impl>
|
class FunctionAnyHash : public TargetSpecific::Default::FunctionAnyHash<Impl, Keyed, KeyType>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FunctionAnyHash(ContextPtr context) : selector(context)
|
explicit FunctionAnyHash(ContextPtr context) : selector(context)
|
||||||
{
|
{
|
||||||
selector.registerImplementation<TargetArch::Default,
|
selector.registerImplementation<TargetArch::Default, TargetSpecific::Default::FunctionAnyHash<Impl, Keyed, KeyType>>();
|
||||||
TargetSpecific::Default::FunctionAnyHash<Impl>>();
|
|
||||||
|
|
||||||
#if USE_MULTITARGET_CODE
|
#if USE_MULTITARGET_CODE
|
||||||
selector.registerImplementation<TargetArch::AVX2,
|
selector.registerImplementation<TargetArch::AVX2, TargetSpecific::AVX2::FunctionAnyHash<Impl, Keyed, KeyType>>();
|
||||||
TargetSpecific::AVX2::FunctionAnyHash<Impl>>();
|
selector.registerImplementation<TargetArch::AVX512F, TargetSpecific::AVX512F::FunctionAnyHash<Impl, Keyed, KeyType>>();
|
||||||
selector.registerImplementation<TargetArch::AVX512F,
|
#endif
|
||||||
TargetSpecific::AVX512F::FunctionAnyHash<Impl>>();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override
|
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t input_rows_count) const override
|
||||||
@ -1514,6 +1609,7 @@ struct NameIntHash32 { static constexpr auto name = "intHash32"; };
|
|||||||
struct NameIntHash64 { static constexpr auto name = "intHash64"; };
|
struct NameIntHash64 { static constexpr auto name = "intHash64"; };
|
||||||
|
|
||||||
using FunctionSipHash64 = FunctionAnyHash<SipHash64Impl>;
|
using FunctionSipHash64 = FunctionAnyHash<SipHash64Impl>;
|
||||||
|
using FunctionSipHash64Keyed = FunctionAnyHash<SipHash64KeyedImpl, true, SipHash64KeyedImpl::Key>;
|
||||||
using FunctionIntHash32 = FunctionIntHash<IntHash32Impl, NameIntHash32>;
|
using FunctionIntHash32 = FunctionIntHash<IntHash32Impl, NameIntHash32>;
|
||||||
using FunctionIntHash64 = FunctionIntHash<IntHash64Impl, NameIntHash64>;
|
using FunctionIntHash64 = FunctionIntHash<IntHash64Impl, NameIntHash64>;
|
||||||
#if USE_SSL
|
#if USE_SSL
|
||||||
@ -1527,6 +1623,7 @@ using FunctionSHA384 = FunctionStringHashFixedString<SHA384Impl>;
|
|||||||
using FunctionSHA512 = FunctionStringHashFixedString<SHA512Impl>;
|
using FunctionSHA512 = FunctionStringHashFixedString<SHA512Impl>;
|
||||||
#endif
|
#endif
|
||||||
using FunctionSipHash128 = FunctionAnyHash<SipHash128Impl>;
|
using FunctionSipHash128 = FunctionAnyHash<SipHash128Impl>;
|
||||||
|
using FunctionSipHash128Keyed = FunctionAnyHash<SipHash128KeyedImpl, true, SipHash128KeyedImpl::Key>;
|
||||||
using FunctionCityHash64 = FunctionAnyHash<ImplCityHash64>;
|
using FunctionCityHash64 = FunctionAnyHash<ImplCityHash64>;
|
||||||
using FunctionFarmFingerprint64 = FunctionAnyHash<ImplFarmFingerprint64>;
|
using FunctionFarmFingerprint64 = FunctionAnyHash<ImplFarmFingerprint64>;
|
||||||
using FunctionFarmHash64 = FunctionAnyHash<ImplFarmHash64>;
|
using FunctionFarmHash64 = FunctionAnyHash<ImplFarmHash64>;
|
||||||
|
@ -12,7 +12,9 @@ namespace DB
|
|||||||
REGISTER_FUNCTION(Hashing)
|
REGISTER_FUNCTION(Hashing)
|
||||||
{
|
{
|
||||||
factory.registerFunction<FunctionSipHash64>();
|
factory.registerFunction<FunctionSipHash64>();
|
||||||
|
factory.registerFunction<FunctionSipHash64Keyed>();
|
||||||
factory.registerFunction<FunctionSipHash128>();
|
factory.registerFunction<FunctionSipHash128>();
|
||||||
|
factory.registerFunction<FunctionSipHash128Keyed>();
|
||||||
factory.registerFunction<FunctionCityHash64>();
|
factory.registerFunction<FunctionCityHash64>();
|
||||||
factory.registerFunction<FunctionFarmFingerprint64>();
|
factory.registerFunction<FunctionFarmFingerprint64>();
|
||||||
factory.registerFunction<FunctionFarmHash64>();
|
factory.registerFunction<FunctionFarmHash64>();
|
||||||
|
227
src/Functions/array/arrayShuffle.cpp
Normal file
227
src/Functions/array/arrayShuffle.cpp
Normal file
@ -0,0 +1,227 @@
|
|||||||
|
#include <Columns/ColumnArray.h>
|
||||||
|
#include <Columns/ColumnFixedString.h>
|
||||||
|
#include <Columns/ColumnNullable.h>
|
||||||
|
#include <Columns/ColumnString.h>
|
||||||
|
#include <DataTypes/DataTypeArray.h>
|
||||||
|
#include <Functions/FunctionFactory.h>
|
||||||
|
#include <Functions/FunctionHelpers.h>
|
||||||
|
#include <Functions/IFunction.h>
|
||||||
|
#include <Common/assert_cast.h>
|
||||||
|
#include <Common/randomSeed.h>
|
||||||
|
#include <Common/shuffle.h>
|
||||||
|
#include <Common/typeid_cast.h>
|
||||||
|
|
||||||
|
#include <pcg_random.hpp>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
|
namespace DB
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace ErrorCodes
|
||||||
|
{
|
||||||
|
extern const int ILLEGAL_COLUMN;
|
||||||
|
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||||
|
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Shuffle array elements
|
||||||
|
* arrayShuffle(arr)
|
||||||
|
* arrayShuffle(arr, seed)
|
||||||
|
*/
|
||||||
|
struct FunctionArrayShuffleTraits
|
||||||
|
{
|
||||||
|
static constexpr auto name = "arrayShuffle";
|
||||||
|
static constexpr auto has_limit = false; // Permute the whole array
|
||||||
|
static ColumnNumbers getArgumentsThatAreAlwaysConstant() { return {1}; }
|
||||||
|
static constexpr auto max_num_params = 2; // array[, seed]
|
||||||
|
static constexpr auto seed_param_idx = 1; // --------^^^^
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Partial shuffle array elements
|
||||||
|
* arrayPartialShuffle(arr)
|
||||||
|
* arrayPartialShuffle(arr, limit)
|
||||||
|
* arrayPartialShuffle(arr, limit, seed)
|
||||||
|
*/
|
||||||
|
struct FunctionArrayPartialShuffleTraits
|
||||||
|
{
|
||||||
|
static constexpr auto name = "arrayPartialShuffle";
|
||||||
|
static constexpr auto has_limit = true;
|
||||||
|
static ColumnNumbers getArgumentsThatAreAlwaysConstant() { return {1, 2}; }
|
||||||
|
static constexpr auto max_num_params = 3; // array[, limit[, seed]]
|
||||||
|
static constexpr auto seed_param_idx = 2; // ----------------^^^^
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename Traits>
|
||||||
|
class FunctionArrayShuffleImpl : public IFunction
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static constexpr auto name = Traits::name;
|
||||||
|
|
||||||
|
String getName() const override { return name; }
|
||||||
|
bool isVariadic() const override { return true; }
|
||||||
|
size_t getNumberOfArguments() const override { return 0; }
|
||||||
|
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return Traits::getArgumentsThatAreAlwaysConstant(); }
|
||||||
|
bool useDefaultImplementationForConstants() const override { return true; }
|
||||||
|
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return true; }
|
||||||
|
|
||||||
|
static FunctionPtr create(ContextPtr) { return std::make_shared<FunctionArrayShuffleImpl<Traits>>(); }
|
||||||
|
|
||||||
|
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
||||||
|
{
|
||||||
|
if (arguments.size() > Traits::max_num_params || arguments.empty())
|
||||||
|
{
|
||||||
|
throw Exception(
|
||||||
|
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH,
|
||||||
|
"Function '{}' needs from 1 to {} arguments, passed {}.",
|
||||||
|
getName(),
|
||||||
|
Traits::max_num_params,
|
||||||
|
arguments.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
const DataTypeArray * array_type = checkAndGetDataType<DataTypeArray>(arguments[0].get());
|
||||||
|
if (!array_type)
|
||||||
|
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "First argument of function '{}' must be array", getName());
|
||||||
|
|
||||||
|
auto check_is_integral = [&](auto param_idx)
|
||||||
|
{
|
||||||
|
WhichDataType which(arguments[param_idx]);
|
||||||
|
if (!which.isUInt() && !which.isInt())
|
||||||
|
throw Exception(
|
||||||
|
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
|
||||||
|
"Illegal type {} of arguments of function {} (must be UInt or Int)",
|
||||||
|
arguments[param_idx]->getName(),
|
||||||
|
getName());
|
||||||
|
};
|
||||||
|
|
||||||
|
for (size_t idx = 1; idx < arguments.size(); ++idx)
|
||||||
|
check_is_integral(idx);
|
||||||
|
|
||||||
|
return arguments[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, size_t) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
static ColumnPtr executeGeneric(const ColumnArray & array, pcg64_fast & rng, size_t limit);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename Traits>
|
||||||
|
ColumnPtr FunctionArrayShuffleImpl<Traits>::executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t) const
|
||||||
|
{
|
||||||
|
const ColumnArray * array = checkAndGetColumn<ColumnArray>(arguments[0].column.get());
|
||||||
|
if (!array)
|
||||||
|
throw Exception(
|
||||||
|
ErrorCodes::ILLEGAL_COLUMN, "Illegal column {} of first argument of function {}", arguments[0].column->getName(), getName());
|
||||||
|
|
||||||
|
const auto seed = [&]() -> uint64_t
|
||||||
|
{
|
||||||
|
// If present, seed comes as the last argument
|
||||||
|
if (arguments.size() != Traits::max_num_params)
|
||||||
|
return randomSeed();
|
||||||
|
const auto * val = arguments[Traits::seed_param_idx].column.get();
|
||||||
|
return val->getUInt(0);
|
||||||
|
}();
|
||||||
|
pcg64_fast rng(seed);
|
||||||
|
|
||||||
|
size_t limit = [&]() -> size_t
|
||||||
|
{
|
||||||
|
if constexpr (Traits::has_limit)
|
||||||
|
{
|
||||||
|
if (arguments.size() > 1)
|
||||||
|
{
|
||||||
|
const auto * val = arguments[1].column.get();
|
||||||
|
return val->getUInt(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}();
|
||||||
|
|
||||||
|
return executeGeneric(*array, rng, limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Traits>
|
||||||
|
ColumnPtr FunctionArrayShuffleImpl<Traits>::executeGeneric(const ColumnArray & array, pcg64_fast & rng, size_t limit [[maybe_unused]])
|
||||||
|
{
|
||||||
|
const ColumnArray::Offsets & offsets = array.getOffsets();
|
||||||
|
|
||||||
|
size_t size = offsets.size();
|
||||||
|
size_t nested_size = array.getData().size();
|
||||||
|
IColumn::Permutation permutation(nested_size);
|
||||||
|
std::iota(std::begin(permutation), std::end(permutation), 0);
|
||||||
|
|
||||||
|
ColumnArray::Offset current_offset = 0;
|
||||||
|
for (size_t i = 0; i < size; ++i)
|
||||||
|
{
|
||||||
|
auto next_offset = offsets[i];
|
||||||
|
if constexpr (Traits::has_limit)
|
||||||
|
{
|
||||||
|
if (limit)
|
||||||
|
{
|
||||||
|
const auto effective_limit = std::min<size_t>(limit, next_offset - current_offset);
|
||||||
|
partial_shuffle(&permutation[current_offset], &permutation[next_offset], effective_limit, rng);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
shuffle(&permutation[current_offset], &permutation[next_offset], rng);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
shuffle(&permutation[current_offset], &permutation[next_offset], rng);
|
||||||
|
current_offset = next_offset;
|
||||||
|
}
|
||||||
|
return ColumnArray::create(array.getData().permute(permutation, 0), array.getOffsetsPtr());
|
||||||
|
}
|
||||||
|
|
||||||
|
REGISTER_FUNCTION(ArrayShuffle)
|
||||||
|
{
|
||||||
|
factory.registerFunction<FunctionArrayShuffleImpl<FunctionArrayShuffleTraits>>(
|
||||||
|
{
|
||||||
|
R"(
|
||||||
|
Returns an array of the same size as the original array containing the elements in shuffled order.
|
||||||
|
Elements are being reordered in such a way that each possible permutation of those elements has equal probability of appearance.
|
||||||
|
|
||||||
|
Note: this function will not materialize constants:
|
||||||
|
[example:materialize]
|
||||||
|
|
||||||
|
If no seed is provided a random one will be used:
|
||||||
|
[example:random_seed]
|
||||||
|
|
||||||
|
It is possible to override the seed to produce stable results:
|
||||||
|
[example:explicit_seed]
|
||||||
|
)",
|
||||||
|
Documentation::Examples{
|
||||||
|
{"random_seed", "SELECT arrayShuffle([1, 2, 3, 4])"},
|
||||||
|
{"explicit_seed", "SELECT arrayShuffle([1, 2, 3, 4], 41)"},
|
||||||
|
{"materialize", "SELECT arrayShuffle(materialize([1, 2, 3]), 42), arrayShuffle([1, 2, 3], 42) FROM numbers(10)"}},
|
||||||
|
Documentation::Categories{"Array"}},
|
||||||
|
FunctionFactory::CaseInsensitive);
|
||||||
|
factory.registerFunction<FunctionArrayShuffleImpl<FunctionArrayPartialShuffleTraits>>(
|
||||||
|
{
|
||||||
|
R"(
|
||||||
|
Returns an array of the same size as the original array where elements in range [1..limit] are a random
|
||||||
|
subset of the original array. Remaining (limit..n] shall contain the elements not in [1..limit] range in undefined order.
|
||||||
|
Value of limit shall be in range [1..n]. Values outside of that range are equivalent to performing full arrayShuffle:
|
||||||
|
[example:no_limit1]
|
||||||
|
[example:no_limit2]
|
||||||
|
|
||||||
|
Note: this function will not materialize constants:
|
||||||
|
[example:materialize]
|
||||||
|
|
||||||
|
If no seed is provided a random one will be used:
|
||||||
|
[example:random_seed]
|
||||||
|
|
||||||
|
It is possible to override the seed to produce stable results:
|
||||||
|
[example:explicit_seed]
|
||||||
|
)",
|
||||||
|
Documentation::Examples{
|
||||||
|
{"no_limit1", "SELECT arrayPartialShuffle([1, 2, 3, 4], 0)"},
|
||||||
|
{"no_limit2", "SELECT arrayPartialShuffle([1, 2, 3, 4])"},
|
||||||
|
{"random_seed", "SELECT arrayPartialShuffle([1, 2, 3, 4], 2)"},
|
||||||
|
{"explicit_seed", "SELECT arrayPartialShuffle([1, 2, 3, 4], 2, 41)"},
|
||||||
|
{"materialize",
|
||||||
|
"SELECT arrayPartialShuffle(materialize([1, 2, 3, 4]), 2, 42), arrayPartialShuffle([1, 2, 3], 2, 42) FROM numbers(10)"}},
|
||||||
|
Documentation::Categories{"Array"}},
|
||||||
|
FunctionFactory::CaseInsensitive);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -478,7 +478,7 @@ private:
|
|||||||
return res.size();
|
return res.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t jodaCentryOfEra(size_t min_represent_digits, char * dest, Time source, UInt64, UInt32, const DateLUTImpl & timezone)
|
static size_t jodaCenturyOfEra(size_t min_represent_digits, char * dest, Time source, UInt64, UInt32, const DateLUTImpl & timezone)
|
||||||
{
|
{
|
||||||
auto year = static_cast<Int32>(ToYearImpl::execute(source, timezone));
|
auto year = static_cast<Int32>(ToYearImpl::execute(source, timezone));
|
||||||
year = (year < 0 ? -year : year);
|
year = (year < 0 ? -year : year);
|
||||||
@ -1137,7 +1137,7 @@ public:
|
|||||||
reserve_size += repetitions <= 3 ? 2 : 13;
|
reserve_size += repetitions <= 3 ? 2 : 13;
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
instructions.emplace_back(std::bind_front(&Action<T>::jodaCentryOfEra, repetitions));
|
instructions.emplace_back(std::bind_front(&Action<T>::jodaCenturyOfEra, repetitions));
|
||||||
/// Year range [1900, 2299]
|
/// Year range [1900, 2299]
|
||||||
reserve_size += std::max(repetitions, 2);
|
reserve_size += std::max(repetitions, 2);
|
||||||
break;
|
break;
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
"arrayMap"
|
"arrayMap"
|
||||||
"arrayMax"
|
"arrayMax"
|
||||||
"arrayMin"
|
"arrayMin"
|
||||||
|
"arrayPartialShuffle"
|
||||||
"arrayPopBack"
|
"arrayPopBack"
|
||||||
"arrayPopFront"
|
"arrayPopFront"
|
||||||
"arrayProduct"
|
"arrayProduct"
|
||||||
@ -84,6 +85,7 @@
|
|||||||
"arrayReverseFill"
|
"arrayReverseFill"
|
||||||
"arrayReverseSort"
|
"arrayReverseSort"
|
||||||
"arrayReverseSplit"
|
"arrayReverseSplit"
|
||||||
|
"arrayShuffle"
|
||||||
"arraySlice"
|
"arraySlice"
|
||||||
"arraySort"
|
"arraySort"
|
||||||
"arraySplit"
|
"arraySplit"
|
||||||
|
@ -872,6 +872,8 @@
|
|||||||
"nullIn"
|
"nullIn"
|
||||||
"MONTH"
|
"MONTH"
|
||||||
"arrayReverse"
|
"arrayReverse"
|
||||||
|
"arrayShuffle"
|
||||||
|
"arrayPartialShuffle"
|
||||||
"now64"
|
"now64"
|
||||||
"DATE"
|
"DATE"
|
||||||
"addressToLine"
|
"addressToLine"
|
||||||
|
@ -646,7 +646,9 @@ simpleJSONHas
|
|||||||
sin
|
sin
|
||||||
sinh
|
sinh
|
||||||
sipHash128
|
sipHash128
|
||||||
|
sipHash128Keyed
|
||||||
sipHash64
|
sipHash64
|
||||||
|
sipHash64Keyed
|
||||||
sleep
|
sleep
|
||||||
sleepEachRow
|
sleepEachRow
|
||||||
snowflakeToDateTime
|
snowflakeToDateTime
|
||||||
|
85
tests/queries/0_stateless/02523_array_shuffle.reference
Normal file
85
tests/queries/0_stateless/02523_array_shuffle.reference
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
[]
|
||||||
|
[]
|
||||||
|
[9223372036854775808]
|
||||||
|
[9223372036854775808]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10.1,9,4,2,5,6,7,1,8,3]
|
||||||
|
[9223372036854775808,9,4,2,5,6,7,1,8,3]
|
||||||
|
[NULL,9,4,2,5,6,7,1,8,3]
|
||||||
|
['789','123','ABC','000','456']
|
||||||
|
['789','123','ABC',NULL,'456']
|
||||||
|
['imposter','storage','sensation','uniform','tiger','terminal']
|
||||||
|
[NULL,'storage','sensation','uniform','tiger','terminal']
|
||||||
|
[NULL]
|
||||||
|
[NULL,NULL]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64],[-1,-2,-3,-4]]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64],[-1,-2,-3,-4]]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64],[NULL,-2,-3,-4]]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,5,48,67,90,20,27,38,19,54,21,83,84,1,22,56,81,91,77,36,63,33,39,24,40,4,99,14,23,94,29,26,96,2,28,31,57,42,88,12,47,58,8,37,82,92,34,6,60,25,43,50,74,70,52,55,62,17,79,65,93,86,7,16,41,59,75,80,45,69,89,85,87,95,64,61,98,49,78,66,15]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,5,48,67,90,20,27,38,19,54,21,83,84,1,22,56,81,91,77,36,63,33,39,24,40,4,99,14,23,94,29,26,96,2,28,31,57,42,88,12,47,58,8,37,82,92,34,6,60,25,43,50,74,70,52,55,62,17,79,65,93,86,7,16,41,59,75,80,45,69,89,85,87,95,64,61,98,49,78,66,15]
|
||||||
|
[(3,-3),(1,-1),(99999999,-99999999)]
|
||||||
|
[(3,'A'),(1,NULL),(2,'a')]
|
||||||
|
[]
|
||||||
|
[]
|
||||||
|
[]
|
||||||
|
[9223372036854775808]
|
||||||
|
[9223372036854775808]
|
||||||
|
[9223372036854775808]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10.1,9,4,2,5,6,7,1,8,3]
|
||||||
|
[9223372036854775808,9,4,2,5,6,7,1,8,3]
|
||||||
|
[NULL,9,4,2,5,6,7,1,8,3]
|
||||||
|
['789','123','ABC','000','456']
|
||||||
|
['789','123','ABC',NULL,'456']
|
||||||
|
['imposter','storage','sensation','uniform','tiger','terminal']
|
||||||
|
[NULL,'storage','sensation','uniform','tiger','terminal']
|
||||||
|
[NULL]
|
||||||
|
[NULL,NULL]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64],[-1,-2,-3,-4]]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64],[NULL,-2,-3,-4]]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,5,48,67,90,20,27,38,19,54,21,83,84,1,22,56,81,91,77,36,63,33,39,24,40,4,99,14,23,94,29,26,96,2,28,31,57,42,88,12,47,58,8,37,82,92,34,6,60,25,43,50,74,70,52,55,62,17,79,65,93,86,7,16,41,59,75,80,45,69,89,85,87,95,64,61,98,49,78,66,15]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,5,48,67,90,20,27,38,19,54,21,83,84,1,22,56,81,91,77,36,63,33,39,24,40,4,99,14,23,94,29,26,96,2,28,31,57,42,88,12,47,58,8,37,82,92,34,6,60,25,43,50,74,70,52,55,62,17,79,65,93,86,7,16,41,59,75,80,45,69,89,85,87,95,64,61,98,49,78,66,15]
|
||||||
|
[(3,-3),(1,-1),(99999999,-99999999)]
|
||||||
|
[(3,'A'),(1,NULL),(2,'a')]
|
||||||
|
[NULL,NULL,NULL]
|
||||||
|
[10,2,3,4,5,6,7,8,9,1]
|
||||||
|
[10,9,3,4,5,6,7,8,2,1]
|
||||||
|
[10,9,4,2,5,6,7,8,3,1]
|
||||||
|
[10,9,4,2,5,6,7,1,3,8]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10,9,4,2,5,6,7,1,8,3]
|
||||||
|
[10.1,9,4,2,5,6,7,8,3,1]
|
||||||
|
[9223372036854775808,9,4,2,5,6,7,8,3,1]
|
||||||
|
[NULL,9,4,2,5,6,7,8,3,1]
|
||||||
|
['789','123','ABC','456','000']
|
||||||
|
['789','123','ABC','456',NULL]
|
||||||
|
['imposter','storage','sensation','terminal','uniform','tiger']
|
||||||
|
[NULL,'storage','sensation','terminal','uniform','tiger']
|
||||||
|
[[10,20,30,40],[1,2,3,4],[-1,-2,-3,-4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]]
|
||||||
|
[[10,20,30,40],[1,2,3,4],[NULL,-2,-3,-4],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,20,21,22,23,24,25,26,27,28,29,17,31,15,33,34,2,36,37,38,39,40,41,42,43,8,45,6,47,48,49,50,16,52,14,54,55,56,57,58,59,60,61,62,63,64,65,66,67,19,69,70,7,1,4,74,75,5,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,12,98,99]
|
||||||
|
[10,72,11,18,73,76,46,71,44,35,9,0,97,53,13,32,51,30,3,68,20,21,22,23,24,25,26,27,28,29,17,31,15,33,34,2,36,37,38,39,40,41,42,43,8,45,6,47,48,49,50,16,52,14,54,55,56,57,58,59,60,61,62,63,64,65,66,67,19,69,70,7,1,4,74,75,5,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,12,98,99]
|
||||||
|
[(3,-3),(1,-1),(99999999,-99999999)]
|
||||||
|
[(3,'A'),(1,NULL),(2,'a')]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[3,1,2]
|
||||||
|
[1,3,2]
|
||||||
|
[2,1,3]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[1,2,3]
|
||||||
|
[3,2,1]
|
||||||
|
[3,2,1]
|
||||||
|
[2,1,3]
|
71
tests/queries/0_stateless/02523_array_shuffle.sql
Normal file
71
tests/queries/0_stateless/02523_array_shuffle.sql
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
SELECT arrayShuffle([]);
|
||||||
|
SELECT arrayShuffle([], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([9223372036854775808]);
|
||||||
|
SELECT arrayShuffle([9223372036854775808], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([1,2,3,4,5,6,7,8,9,10], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle(materialize([1,2,3,4,5,6,7,8,9,10]), 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([1,2,3,4,5,6,7,8,9,10.1], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([1,2,3,4,5,6,7,8,9,9223372036854775808], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([1,2,3,4,5,6,7,8,9,NULL], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), toFixedString('000', 3)], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), NULL], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle(['storage','tiger','imposter','terminal','uniform','sensation'], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle(['storage','tiger',NULL,'terminal','uniform','sensation'], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([NULL]);
|
||||||
|
SELECT arrayShuffle([NULL,NULL]);
|
||||||
|
SELECT arrayShuffle([[1,2,3,4],[-1,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle(materialize([[1,2,3,4],[-1,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]]), 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([[1,2,3,4],[NULL,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle(groupArray(x),0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayShuffle(groupArray(toUInt64(x)),0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayShuffle([tuple(1, -1), tuple(99999999, -99999999), tuple(3, -3)], 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([tuple(1, NULL), tuple(2, 'a'), tuple(3, 'A')], 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([]); -- trivial cases (equivalent to arrayShuffle)
|
||||||
|
SELECT arrayPartialShuffle([], 0);
|
||||||
|
SELECT arrayPartialShuffle([], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([9223372036854775808]);
|
||||||
|
SELECT arrayPartialShuffle([9223372036854775808], 0);
|
||||||
|
SELECT arrayPartialShuffle([9223372036854775808], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10.1], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,9223372036854775808], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,NULL], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), toFixedString('000', 3)], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), NULL], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(['storage','tiger','imposter','terminal','uniform','sensation'], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(['storage','tiger',NULL,'terminal','uniform','sensation'], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([NULL]);
|
||||||
|
SELECT arrayPartialShuffle([NULL,NULL]);
|
||||||
|
SELECT arrayPartialShuffle([[1,2,3,4],[-1,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([[1,2,3,4],[NULL,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(groupArray(x),0,0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayPartialShuffle(groupArray(toUInt64(x)),0,0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayPartialShuffle([tuple(1, -1), tuple(99999999, -99999999), tuple(3, -3)], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([tuple(1, NULL), tuple(2, 'a'), tuple(3, 'A')], 0, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([NULL,NULL,NULL], 2); -- other, mostly non-trivial cases
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 1, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 2, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 4, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 8, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 9, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 10, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10], 100, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,10.1], 4, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,9223372036854775808], 4, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([1,2,3,4,5,6,7,8,9,NULL], 4, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), toFixedString('000', 3)], 3, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([toFixedString('123', 3), toFixedString('456', 3), toFixedString('789', 3), toFixedString('ABC', 3), NULL], 3, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(['storage','tiger','imposter','terminal','uniform','sensation'], 3, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(['storage','tiger',NULL,'terminal','uniform','sensation'], 3, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([[1,2,3,4],[-1,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 2, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([[1,2,3,4],[NULL,-2,-3,-4],[10,20,30,40],[100,200,300,400,500,600,700,800,900],[2,4,8,16,32,64]], 2, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle(groupArray(x),20,0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayPartialShuffle(groupArray(toUInt64(x)),20,0xbad_cafe) FROM (SELECT number as x from system.numbers LIMIT 100);
|
||||||
|
SELECT arrayPartialShuffle([tuple(1, -1), tuple(99999999, -99999999), tuple(3, -3)], 2, 0xbad_cafe);
|
||||||
|
SELECT arrayPartialShuffle([tuple(1, NULL), tuple(2, 'a'), tuple(3, 'A')], 2, 0xbad_cafe);
|
||||||
|
SELECT arrayShuffle([1, 2, 3], 42) FROM numbers(10); -- for constant array we don not materialize it and each row gets the same permutation
|
||||||
|
SELECT arrayShuffle(materialize([1, 2, 3]), 42) FROM numbers(10);
|
||||||
|
SELECT arrayShuffle(1); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||||
|
SELECT arrayShuffle([1], 'a'); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||||
|
SELECT arrayShuffle([1], 1.1); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
||||||
|
SELECT arrayShuffle([1], 0xcafe, 1); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
|
196
tests/queries/0_stateless/025334_keyed_siphash.reference
Normal file
196
tests/queries/0_stateless/025334_keyed_siphash.reference
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
726FDB47DD0E0E31
|
||||||
|
74F839C593DC67FD
|
||||||
|
0D6C8009D9A94F5A
|
||||||
|
85676696D7FB7E2D
|
||||||
|
CF2794E0277187B7
|
||||||
|
18765564CD99A68D
|
||||||
|
CBC9466E58FEE3CE
|
||||||
|
AB0200F58B01D137
|
||||||
|
93F5F5799A932462
|
||||||
|
9E0082DF0BA9E4B0
|
||||||
|
7A5DBBC594DDB9F3
|
||||||
|
F4B32F46226BADA7
|
||||||
|
751E8FBC860EE5FB
|
||||||
|
14EA5627C0843D90
|
||||||
|
F723CA908E7AF2EE
|
||||||
|
A129CA6149BE45E5
|
||||||
|
3F2ACC7F57C29BDB
|
||||||
|
699AE9F52CBE4794
|
||||||
|
4BC1B3F0968DD39C
|
||||||
|
BB6DC91DA77961BD
|
||||||
|
BED65CF21AA2EE98
|
||||||
|
D0F2CBB02E3B67C7
|
||||||
|
93536795E3A33E88
|
||||||
|
A80C038CCD5CCEC8
|
||||||
|
B8AD50C6F649AF94
|
||||||
|
BCE192DE8A85B8EA
|
||||||
|
17D835B85BBB15F3
|
||||||
|
2F2E6163076BCFAD
|
||||||
|
DE4DAAACA71DC9A5
|
||||||
|
A6A2506687956571
|
||||||
|
AD87A3535C49EF28
|
||||||
|
32D892FAD841C342
|
||||||
|
7127512F72F27CCE
|
||||||
|
A7F32346F95978E3
|
||||||
|
12E0B01ABB051238
|
||||||
|
15E034D40FA197AE
|
||||||
|
314DFFBE0815A3B4
|
||||||
|
027990F029623981
|
||||||
|
CADCD4E59EF40C4D
|
||||||
|
9ABFD8766A33735C
|
||||||
|
0E3EA96B5304A7D0
|
||||||
|
AD0C42D6FC585992
|
||||||
|
187306C89BC215A9
|
||||||
|
D4A60ABCF3792B95
|
||||||
|
F935451DE4F21DF2
|
||||||
|
A9538F0419755787
|
||||||
|
DB9ACDDFF56CA510
|
||||||
|
D06C98CD5C0975EB
|
||||||
|
E612A3CB9ECBA951
|
||||||
|
C766E62CFCADAF96
|
||||||
|
EE64435A9752FE72
|
||||||
|
A192D576B245165A
|
||||||
|
0A8787BF8ECB74B2
|
||||||
|
81B3E73D20B49B6F
|
||||||
|
7FA8220BA3B2ECEA
|
||||||
|
245731C13CA42499
|
||||||
|
B78DBFAF3A8D83BD
|
||||||
|
EA1AD565322A1A0B
|
||||||
|
60E61C23A3795013
|
||||||
|
6606D7E446282B93
|
||||||
|
6CA4ECB15C5F91E1
|
||||||
|
9F626DA15C9625F3
|
||||||
|
E51B38608EF25F57
|
||||||
|
958A324CEB064572
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
E28DBDE7FE22E41C
|
||||||
|
1CE422FEE7BD8DE20000000000000000
|
||||||
|
E28DBDE7FE22E41C
|
||||||
|
1CE422FEE7BD8DE20000000000000000
|
274
tests/queries/0_stateless/025334_keyed_siphash.sql
Normal file
274
tests/queries/0_stateless/025334_keyed_siphash.sql
Normal file
@ -0,0 +1,274 @@
|
|||||||
|
-- Test Vectors from the SipHash reference C implementation:
|
||||||
|
-- Written in 2012 by
|
||||||
|
-- Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
|
||||||
|
-- Daniel J. Bernstein <djb@cr.yp.to>
|
||||||
|
-- Released under CC0
|
||||||
|
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
''));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61)));
|
||||||
|
select hex(sipHash64Keyed((toUInt64(506097522914230528), toUInt64(1084818905618843912)),
|
||||||
|
char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62)));
|
||||||
|
|
||||||
|
-- CH tests
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0)) == sipHash64(char(0));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1)) == sipHash64(char(0, 1));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2)) == sipHash64(char(0, 1, 2));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3)) == sipHash64(char(0, 1, 2, 3));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4)) == sipHash64(char(0, 1, 2, 3, 4));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5)) == sipHash64(char(0, 1, 2, 3, 4, 5));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62));
|
||||||
|
select sipHash64Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)) == sipHash64(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0)) == sipHash128(char(0));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1)) == sipHash128(char(0, 1));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2)) == sipHash128(char(0, 1, 2));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3)) == sipHash128(char(0, 1, 2, 3));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4)) == sipHash128(char(0, 1, 2, 3, 4));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5)) == sipHash128(char(0, 1, 2, 3, 4, 5));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62));
|
||||||
|
select sipHash128Keyed((toUInt64(0),toUInt64(0)),char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63)) == sipHash128(char(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63));
|
||||||
|
|
||||||
|
select sipHash64Keyed((0, 0), '1'); -- { serverError 48 }
|
||||||
|
select sipHash128Keyed((0, 0), '1'); -- { serverError 48 }
|
||||||
|
select sipHash64Keyed(toUInt64(0), '1'); -- { serverError 48 }
|
||||||
|
select sipHash128Keyed(toUInt64(0), '1'); -- { serverError 48 }
|
||||||
|
|
||||||
|
select hex(sipHash64());
|
||||||
|
select hex(sipHash128());
|
||||||
|
select hex(sipHash64Keyed());
|
||||||
|
select hex(sipHash128Keyed());
|
Loading…
Reference in New Issue
Block a user