Hash functions can be used to irreversibly and pseudo-randomly shuffle elements.
Calculate the MD5 of a string. Then, acquire the first 8 bytes of the result and return them as UInt64 (big endian). This function is quite inefficient (5 million short strings/seconds/core). If you do not need to use MD5, use the ‘sipHash64’ function.
Calculates the MD5 of a String and returns the result in FixedString(16). If you only need a 128-bit hash and don't necessarily need to use MD5, use the ‘sipHash128’ function. If you want to get the same output as the md5sum program, use lower(hex(MD5(s))).
Calculates the SipHash of a String. Takes a String type parameter and returns UInt64. SipHash is an encryption hash function. Its processing performance is at least three times faster than MD5. For Details, see link: https://131002.net/siphash/
Calculates the SipHash of a String. Accepts a String Type Param and Returns FixedString(16). The difference and the sipHash64 function is that its final Result is 128 bits.
Calculates the CityHash64 of any Quantity of Strings or the Hash function of any Quantity of Other Types using a specific implementation. For Strings, use the CityHash algorithm. This is a fast, non-cryptographic hash function for Strings. For other types of params, use a specific implementation of the Hash function, which is a fast, non-cryptographic hash function. If multiple params are passed, CityHash is used to combine the Hash result of these params. For example, you can calculate the checksum of the entire table, the result of which depends on the order of the rows: SELECT sum(cityHash64(*)) FROM table.
Calculate a 32-bit hash for any type of Integer. This is a relatively efficient, non-cryptographic Hash function.
Calculate a 64-bit hash code from any type of Integer. It works faster compared with the intHash32 function.
Calculates the SHA-1, SHA-224, or SHA-256 of a String, and returns the resulting byte set as FixedString(20), FixedString(28), or FixedString(32). This function is quite inefficient (SHA-1 is approximately 5 million short Strings/seconds/Core, and SHA-224 and SHA-256 are approximately 2.2 million short Strings/seconds/Core). We Suggest using these functions only when you have to use them and cannot change anything. Even in these cases, we still Suggest adopting the Method / way of pre-calculating the function when writing Data. Instead of calculating them in SELECT.
A fast, non-cryptographic hash function used to normalize strings obtained from URLs. URLHash(s) - Calculates a hash from a string, ignoring trailing symbols if they exist: /, ? Or #. URLHash(s, N) - Calculates the hash value of a string to level N in the URL hierarchy, ignoring trailing symbols if they exist: /, ? Or #. The level of the URL is the same as in URLHierarchy. This function is used in Yandex.Metrica.
Calculates the FarmHash64 of a string. Accepts a String type param. Return UInt64. For More Details, please refer to the link: FarmHash64
Calculate the JavaHash of the String. Accepts a String type param. Return Int32. For More Details, please refer to the link: JavaHash
Calculate the HiveHash of a String. Accepts a String type param. Back Int32. And is the same as JavaHash
Calculate the MetroHash of a String. Accepts a String type param. Back UInt64. For more Details, please refer to the link: MetroHash64
Calculate the UInt64's JumpConsistentHash. Accept params of UInt64 Type. Back Int32. For More Details, please see the link: JumpConsistentHash
Calculate the String's MurmurHash2. Accepts a String-type param. Returns UInt64 or UInt32. For more details, please refer to the link: MurmurHash2
Calculates the MurmurHash3 of a String. Accepts a String-type param. Returns UInt64 or UInt32 or FixedString(16). For more details, please refer to the link: MurmurHash3
Calculate the xxHash of the String. Accepts a String Type Param. Back UInt64 or UInt32. For More Details, see link: xxHash