The GET_SQL_HASH function calculates the hash value of a specified string by using the MD5 algorithm.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_UTILITY.GET_SQL_HASH (
NAME IN VARCHAR2,
HASH OUT RAW,
PRE10IHASH OUT NUMBER)
RETURN NUMBER;
Parameters
| Parameter | Description |
|---|---|
| name | The string to be hashed. |
| hash | The parameter used to store the returned 16-byte hash value. This parameter is optional. |
| pre10ihash | This parameter is not supported in the current version, and NULL is returned. |
Return values
The hash value (last four bytes) of the input string is returned.
The MD5 algorithm calculates a 16-byte hash value, but this function returns only the last four bytes to obtain an actual number. You can also use the optional hash parameter to obtain all the 16 bytes.