Skip to content

Commit

Permalink
Update examples using md5(...) to use hash('md5', ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
mumumu committed Aug 1, 2024
1 parent 9c65bd2 commit df1f4ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions reference/mcrypt/functions/mcrypt-module-open.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e41806c30bf6975e452c0d4ce35ab0984c2fa68c Maintainer: hirokawa Status: ready -->
<!-- EN-Revision: f27cfeeefc13717f86a53d7fefa0ce54f7bfaaaf Maintainer: hirokawa Status: ready -->
<!-- Credits: mumumu -->
<refentry xml:id="function.mcrypt-module-open" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -124,8 +124,8 @@
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);
$ks = mcrypt_enc_get_key_size($td);
/* キーを作成します */
$key = substr(md5('very secret key'), 0, $ks);
/* キーを作成します (例示のみ: MD5 は、この用途には不向きなハッシュアルゴリズムです) */
$key = substr(hash('md5', 'very secret key'), 0, $ks);
/* 暗号化処理を初期化します */
mcrypt_generic_init($td, $key, $iv);
Expand Down
4 changes: 2 additions & 2 deletions reference/pdo_sqlite/PDO/sqliteCreateFunction.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9e0f03ac354d797d1d16c0fcc1663e5e170f2727 Maintainer: takagi Status: ready -->
<!-- EN-Revision: f27cfeeefc13717f86a53d7fefa0ce54f7bfaaaf Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->
<refentry xml:id="pdo.sqlitecreatefunction" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -149,7 +149,7 @@
<?php
function md5_and_reverse($string)
{
return strrev(md5($string));
return strrev(hash('md5', $string));
}
$db = new PDO('sqlite:sqlitedb');
Expand Down
4 changes: 2 additions & 2 deletions reference/radius/functions/radius-put-attr.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e6553e39c9d6a20588c464b9af07cbdf07cfe07d Maintainer: takagi Status: ready -->
<!-- EN-Revision: f27cfeeefc13717f86a53d7fefa0ce54f7bfaaaf Maintainer: takagi Status: ready -->
<refentry xml:id="function.radius-put-attr" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>radius_put_attr</refname>
Expand Down Expand Up @@ -85,7 +85,7 @@
<?php
mt_srand(time());
$chall = mt_rand();
$chapval = md5(pack('Ca*',1 , 'sepp' . $chall));
$chapval = hash('md5', pack('Ca*',1 , 'sepp' . $chall));
$pass = pack('CH*', 1, $chapval);
if (!radius_put_attr($res, RADIUS_CHAP_PASSWORD, $pass)) {
echo 'RadiusError:' . radius_strerror($res). "\n<br />";
Expand Down
4 changes: 2 additions & 2 deletions reference/sqlite3/sqlite3/createfunction.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 855bfee2f3db70d7dbb4c60c7c4a4efa567f1c60 Maintainer: takagi Status: ready -->
<!-- EN-Revision: f27cfeeefc13717f86a53d7fefa0ce54f7bfaaaf Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->

<refentry xml:id="sqlite3.createfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
Expand Down Expand Up @@ -136,7 +136,7 @@
<![CDATA[
<?php
function my_udf_md5($string) {
return md5($string);
return hash('md5', $string);
}
$db = new SQLite3('mysqlitedb.db');
Expand Down

0 comments on commit df1f4ca

Please sign in to comment.