cvs: phpdoc-da /reference/strings/functions crypt.xml similar-text.xml sscanf.xml
[email protected] ("Jonathan Holst")
| Newsgroups | php.doc.da |
|---|---|
| Message-ID | <cvsholst1091720314@cvsserver> |
holst Thu Aug 5 11:38:34 2004 EDT
Modified files:
/phpdoc-da/reference/strings/functions sscanf.xml similar-text.xml
crypt.xml
Log:
Sync with EN
http://cvs.php.net/diff.php/phpdoc-da/reference/strings/functions/sscanf.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc-da/reference/strings/functions/sscanf.xml
diff -u phpdoc-da/reference/strings/functions/sscanf.xml:1.2 phpdoc-da/reference/strings/functions/sscanf.xml:1.3
--- phpdoc-da/reference/strings/functions/sscanf.xml:1.2 Tue Jul 27 14:52:42 2004
+++ phpdoc-da/reference/strings/functions/sscanf.xml Thu Aug 5 11:38:33 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- EN-Revision: 1.10 Maintainer: holst Status: ready -->
<refentry id="function.sscanf">
<refnamediv>
@@ -14,7 +14,7 @@
<type>mixed</type><methodname>sscanf</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam><type>string</type><parameter>format</parameter></methodparam>
- <methodparam choice="opt"><type>mixed</type><parameter>& ...</parameter></methodparam>
+ <methodparam choice="opt"><type>mixed</type><parameter>&...</parameter></methodparam>
</methodsynopsis>
<para>
Funktionen <function>sscanf</function> er inputanalogen til
http://cvs.php.net/diff.php/phpdoc-da/reference/strings/functions/similar-text.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc-da/reference/strings/functions/similar-text.xml
diff -u phpdoc-da/reference/strings/functions/similar-text.xml:1.2 phpdoc-da/reference/strings/functions/similar-text.xml:1.3
--- phpdoc-da/reference/strings/functions/similar-text.xml:1.2 Fri Jul 23 10:27:38 2004
+++ phpdoc-da/reference/strings/functions/similar-text.xml Thu Aug 5 11:38:33 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- EN-Revision: 1.2 Maintainer: holst Status: ready -->
<refentry id="function.similar-text">
<refnamediv>
@@ -14,7 +14,7 @@
<type>int</type><methodname>similar_text</methodname>
<methodparam><type>string</type><parameter>first</parameter></methodparam>
<methodparam><type>string</type><parameter>second</parameter></methodparam>
- <methodparam choice="opt"><type>float</type><parameter>percent</parameter></methodparam>
+ <methodparam choice="opt"><type>float</type><parameter>&percent</parameter></methodparam>
</methodsynopsis>
<para>
Dette beregner ligheden mellem to strenge som beskrevet i Oliver [1993].
http://cvs.php.net/diff.php/phpdoc-da/reference/strings/functions/crypt.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc-da/reference/strings/functions/crypt.xml
diff -u phpdoc-da/reference/strings/functions/crypt.xml:1.1 phpdoc-da/reference/strings/functions/crypt.xml:1.2
--- phpdoc-da/reference/strings/functions/crypt.xml:1.1 Sun Jul 25 07:13:21 2004
+++ phpdoc-da/reference/strings/functions/crypt.xml Thu Aug 5 11:38:33 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<!-- EN-Revision: 1.5 Maintainer: holst Status: ready -->
<refentry id="function.crypt">
<refnamediv>
@@ -73,7 +73,7 @@
<listitem>
<simpara>
CRYPT_BLOWFISH - Blowfish kryptering med en sekstenstegns salt
- startende med $2$
+ startende med $2$ eller $2a$
</simpara>
</listitem>
</itemizedlist>
@@ -103,21 +103,51 @@
</example>
<example>
<title>Brug af <function>crypt</function> med htpasswd</title>
- <para>
- For at lave et kodeord til brug med en apache htpasswd-fil, er du nødt
- til at bruge de første to bogstaver af kodeordet som salt.
- </para>
<programlisting role="php">
<![CDATA[
<?php
// Sæt kodeordet
$password = 'mypassword';
-// Få hash'en
-$hash = crypt($password, substr($password, 0, 2));
+// Hent hash'en, og lader salten blive genereret automatisk
+$hash = crypt($password);
?>
]]>
</programlisting>
+ </example>
+ <example>
+ <title>Brug af <function>crypt</function> med forskellige
+ krypteringstyper</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+if(CRYPT_STD_DES == 1) {
+ echo 'Standard DES: '.crypt('rasmuslerdorf', 'rl') . "\n";
+}
+if (CRYPT_EXT_DES == 1) {
+ echo 'Udvidet DES: ' . crypt('rasmuslerdorf', '_J9..rasm') . "\n";
+}
+if (CRYPT_MD5 == 1) {
+ echo 'MD5: ' . crypt('rasmuslerdorf', '$1$rasmusle$') . "\n";
+}
+if (CRYPT_BLOWFISH == 1) {
+ echo 'Blowfish: ' . crypt('rasmuslerdorf',
+ '$2a$07$rasmuslerd...........$') . "\n";
+}
+?>
+]]>
+ </programlisting>
+ <para>
+ Ovenstående eksempel vil udskrive noget i stil med:
+ </para>
+ <screen>
+<![CDATA[
+Standard DES: rl.3StKT.4T8M
+Udvidet DES: _J9..rasmBYk8r9AiWNc
+MD5: $1$rasmusle$rISCgZzpwk3UhDidwXvin0
+Blowfish: $2a$07$rasmuslerd............nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra
+]]>
+ </screen>
</example>
<simpara>
Se også