oracle PL/SQL 中是否有 MD5 Sum 函数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8827184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 03:50:19  来源:igfitidea点击:

Is there an MD5 Sum function in PL/SQL

oraclemd5md5sum

提问by Bob Kuhar

In Oracle SQL, is there an MD5 function or something available to me? I would like to do something like...

在 Oracle SQL 中,是否有 MD5 函数或其他可用的东西?我想做一些像......

select name, md5_sum( name ) from person;

采纳答案by René Nyffenegger

See this Tahiti Link. Under MD5 Procedures and Functionsit says These subprograms generate MD5 hashes of data. The MD5 algorithm ensures data integrity by generating a 128-bit cryptographic message digest value from given data.

看到这个大溪地链接。在MD5 过程和函数下,它说这些子程序生成数据的 MD5 哈希值。MD5 算法通过从给定数据生成 128 位加密消息摘要值来确保数据完整性。

Also note, that DBMS_OBFUSCATION_TOOLKITis deprecated and can/should be replaced with DBMS_CRYPTO, see this Tahiti Link

另请注意,DBMS_OBFUSCATION_TOOLKIT已弃用,可以/应该替换为DBMS_CRYPTO,请参阅此 Tahiti Link

回答by Eddie Awad

You may want to check the DBMS_OBFUSCATION_TOOLKIT.MD5procedure.

您可能需要检查DBMS_OBFUSCATION_TOOLKIT.MD5过程。

Here is an example:

下面是一个例子:

     SQL> column md5_val FORMAT A40
     SQL> SELECT DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw('Eddie')) md5_val
       2    FROM DUAL;
     MD5_VAL
     ----------------------------------------
     E5F6C83E6E97C74FC9E9760FC8972AED

     1 row selected.

回答by Jon Heller

In 12c you can use STANDARD_HASH. It's available by default, does not require any PL/SQL objects or hard-coded values, and is not deprecated.

在 12c 中,您可以使用STANDARD_HASH。它在默认情况下可用,不需要任何 PL/SQL 对象或硬编码值,并且不被弃用。

SQL> select standard_hash('Finally, an easy way to do this.', 'MD5') md5
  2  from dual;

MD5
--------------------------------
456E4D024B4BB704169E21DEB895B0E2

回答by ligerdave

don't think it comes with it right out of box. you need to define your own.

不要认为它是开箱即用的。你需要定义你自己的。