A one-way hash function (HASH) takes a variable-length input string and converts it into a fixed-length (usually smaller) output called a hash value. The hash value serves as a unique identifier for the input data, similar to a fingerprint. You can use the hash value to verify whether the data has been altered.
Since it is easy to compute a hash value from input data but difficult to generate the original data from the hash value, one-way hash functions are effective in ensuring data integrity.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_CRYPTO.Hash (
src IN RAW,
typ IN PLS_INTEGER)
RETURN RAW;
DBMS_CRYPTO.Hash (
src IN BLOB,
typ IN PLS_INTEGER)
RETURN RAW;
DBMS_CRYPTO.Hash (
src IN CLOB CHARACTER SET ANY_CS,
typ IN PLS_INTEGER)
RETURN RAW;
Parameters
| Parameter | Description |
|---|---|
| src | The source data to be hashed. |
| typ | The hash algorithm to be used. |
Considerations
We recommend that you use SHA-1 or SHA-2, which are more resistant to brute-force attacks than MD4 or MD5. If you must use the Message Digest algorithm, MD5 provides higher security than MD4.
