PL / SQL中是否有哈希函数?
我正在寻找PL / SQL中的Hash函数,以获取varchar的哈希值。我在Oracle 10中找到了一个名为dbms_crypto的软件包,其函数为dbms_crypto.hash,甚至还有其他软件包dbms_sqlhash.getHash,但是在我调用它们的地方,我收到的消息就是找不到它们...
有人知道我怎么称呼他们?还有其他套餐吗?
这是我的代码
DECLARE
l_textToHash VARCHAR2(19) := 'toto123';
l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_textToHash);
l_encrypted_raw RAW(2048);
BEGIN
dbms_output.put_line('CC: ' || l_ccn_raw);
l_encrypted_raw := dbms_crypto.hash(l_ccn_raw, 3);
dbms_output.put_line('SH1: ' || l_encrypted_raw);
END;
/
这是消息
Error starting at line 1 in command:
DECLARE
l_textToHash VARCHAR2(19) := 'toto123';
l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_textToHash);
l_encrypted_raw RAW(2048);
BEGIN
dbms_output.put_line('CC: ' || l_ccn_raw);
l_encrypted_raw := dbms_crypto.hash(l_ccn_raw, 3);
dbms_output.put_line('SH1: ' || l_encrypted_raw);
END;
Error report:
ORA-06550: line 7, column 22:
PLS-00201: identifier 'DBMS_CRYPTO' must be declared
ORA-06550: line 7, column 3:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
谢谢!
没有找到相关结果
已邀请:
2 个回复
素汞读
摊揉售
如果您需要加密安全散列函数,我不会尝试使用它。但是如果你只需要一个简单的哈希,那就足够了。