The GET_HASH_VALUE function calculates the hash value of a specified string.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_UTILITY.GET_HASH_VALUE (
name VARCHAR2,
base NUMBER,
hash_size NUMBER)
RETURN NUMBER;
Parameters
| Parameter | Description |
|---|---|
| name | The string to be hashed. |
| base | The base value at which hash values start to be generated. |
| hash_size | The required size of the hash table. |
Return values
A hash value based on the input string is returned. For example, to obtain the hash value of a string with a hash value between 1000 and 3047, you can use 1000 as the base value and 2048 as the hash_size value. We recommend that you set hash_size to a power of 2.