reference/password/constants.xml
c6532951edb85836f2d49a3c81f8f5e1e41d3554
...
...
@@ -10,7 +10,7 @@
10
10
<varlistentry xml:id="constant.password-bcrypt">
11
11
<term>
12
12
<constant>PASSWORD_BCRYPT</constant>
13
-
(<type>integer</type>)
13
+
(<type>string</type>)
14
14
</term>
15
15
<listitem>
16
16
<para>
...
...
@@ -38,7 +38,7 @@
38
38
</listitem>
39
39
<listitem>
40
40
<para>
41
-
<literal>cost</literal> (<type>integer</type>) - which denotes the algorithmic cost that
41
+
<literal>cost</literal> (<type>int</type>) - which denotes the algorithmic cost that
42
42
should be used. Examples of these values can be found on the <function>crypt</function>
43
43
page.
44
44
</para>
...
...
@@ -50,15 +50,27 @@
50
50
</itemizedlist>
51
51
</listitem>
52
52
</varlistentry>
53
+
<varlistentry xml:id="constant.password-bcrypt-default-cost">
54
+
<term>
55
+
<constant>PASSWORD_BCRYPT_DEFAULT_COST</constant>
56
+
(<type>int</type>)
57
+
</term>
58
+
<listitem>
59
+
<para>
60
+
</para>
61
+
<para>
62
+
</para>
63
+
</listitem>
64
+
</varlistentry>
53
65
<varlistentry xml:id="constant.password-argon2i">
54
66
<term>
55
67
<constant>PASSWORD_ARGON2I</constant>
56
-
(<type>integer</type>)
68
+
(<type>string</type>)
57
69
</term>
58
70
<listitem>
59
71
<para>
60
72
<constant>PASSWORD_ARGON2I</constant> is used to create new password
61
-
hashes using the Argon2 algorithm.
73
+
hashes using the Argon2i algorithm.
62
74
</para>
63
75
<para>
64
76
Supported Options:
...
...
@@ -66,20 +78,21 @@
66
78
<itemizedlist>
67
79
<listitem>
68
80
<para>
69
-
<literal>memory_cost</literal> (<type>integer</type>) - Maximum memory (in bytes) that may
81
+
<literal>memory_cost</literal> (<type>int</type>) - Maximum memory (in kibibytes) that may
70
82
be used to compute the Argon2 hash. Defaults to <constant>PASSWORD_ARGON2_DEFAULT_MEMORY_COST</constant>.
71
83
</para>
72
84
</listitem>
73
85
<listitem>
74
86
<para>
75
-
<literal>time_cost</literal> (<type>integer</type>) - Maximum amount of time it may
87
+
<literal>time_cost</literal> (<type>int</type>) - Maximum amount of time it may
76
88
take to compute the Argon2 hash. Defaults to <constant>PASSWORD_ARGON2_DEFAULT_TIME_COST</constant>.
77
89
</para>
78
90
</listitem>
79
91
<listitem>
80
92
<para>
81
-
<literal>threads</literal> (<type>integer</type>) - Number of threads to use for computing
93
+
<literal>threads</literal> (<type>int</type>) - Number of threads to use for computing
82
94
the Argon2 hash. Defaults to <constant>PASSWORD_ARGON2_DEFAULT_THREADS</constant>.
95
+
Only available with libargon2, not with libsodium implementation.
83
96
</para>
84
97
</listitem>
85
98
</itemizedlist>
...
...
@@ -88,14 +101,30 @@
88
101
</para>
89
102
</listitem>
90
103
</varlistentry>
104
+
<varlistentry xml:id="constant.password-argon2id">
105
+
<term>
106
+
<constant>PASSWORD_ARGON2ID</constant>
107
+
(<type>string</type>)
108
+
</term>
109
+
<listitem>
110
+
<para>
111
+
<constant>PASSWORD_ARGON2ID</constant> is used to create new password
112
+
hashes using the Argon2id algorithm. It supports the same options as
113
+
<link linkend="constant.password-argon2i"><constant>PASSWORD_ARGON2I</constant></link>.
114
+
</para>
115
+
<para>
116
+
Available as of PHP 7.3.0.
117
+
</para>
118
+
</listitem>
119
+
</varlistentry>
91
120
<varlistentry xml:id="constant.password-argon2-default-memory-cost">
92
121
<term>
93
122
<constant>PASSWORD_ARGON2_DEFAULT_MEMORY_COST</constant>
94
-
(<type>integer</type>)
123
+
(<type>int</type>)
95
124
</term>
96
125
<listitem>
97
126
<para>
98
-
Default amount of memory in bytes that Argon2lib will use while trying to
127
+
Default amount of memory in bytes that will be used while trying to
99
128
compute a hash.
100
129
</para>
101
130
<para>
...
...
@@ -106,11 +135,11 @@
106
135
<varlistentry xml:id="constant.password-argon2-default-time-cost">
107
136
<term>
108
137
<constant>PASSWORD_ARGON2_DEFAULT_TIME_COST</constant>
109
-
(<type>integer</type>)
138
+
(<type>int</type>)
110
139
</term>
111
140
<listitem>
112
141
<para>
113
-
Default amount of time that Argon2lib will spend trying to compute a hash.
142
+
Default amount of time that will be spent trying to compute a hash.
114
143
</para>
115
144
<para>
116
145
Available as of PHP 7.2.0.
...
...
@@ -120,21 +149,35 @@
120
149
<varlistentry xml:id="constant.password-argon2-default-threads">
121
150
<term>
122
151
<constant>PASSWORD_ARGON2_DEFAULT_THREADS</constant>
123
-
(<type>integer</type>)
152
+
(<type>int</type>)
124
153
</term>
125
154
<listitem>
126
155
<para>
127
156
Default number of threads that Argon2lib will use.
157
+
Not available with libsodium implementation.
128
158
</para>
129
159
<para>
130
160
Available as of PHP 7.2.0.
131
161
</para>
132
162
</listitem>
133
163
</varlistentry>
164
+
<varlistentry xml:id="constant.password-argon2-provider">
165
+
<term>
166
+
<constant>PASSWORD_ARGON2_PROVIDER</constant>
167
+
(<type>string</type>)
168
+
</term>
169
+
<listitem>
170
+
<para>
171
+
</para>
172
+
<para>
173
+
Available as of PHP 7.4.0.
174
+
</para>
175
+
</listitem>
176
+
</varlistentry>
134
177
<varlistentry xml:id="constant.password-default">
135
178
<term>
136
179
<constant>PASSWORD_DEFAULT</constant>
137
-
(<type>integer</type>)
180
+
(<type>mixed</type>)
138
181
</term>
139
182
<listitem>
140
183
<para>
...
...
@@ -147,7 +190,7 @@
147
190
change. Therefore you should be aware that the length of the resulting
148
191
hash can change. Therefore, if you use <constant>PASSWORD_DEFAULT</constant>
149
192
you should store the resulting hash in a way that can store more than 60
150
-
characters (255 is the recomended width).
193
+
characters (255 is the recommended width).
151
194
</para>
152
195
<para>
153
196
Values for this constant:
...
...
@@ -163,6 +206,33 @@
163
206
</varlistentry>
164
207
</variablelist>
165
208
</para>
209
+

210
+
<formalpara>
211
+
&reftitle.changelog;
212
+
<para>
213
+
<informaltable>
214
+
<tgroup cols="2">
215
+
<thead>
216
+
<row>
217
+
<entry>&Version;</entry>
218
+
<entry>&Description;</entry>
219
+
</row>
220
+
</thead>
221
+
<tbody>
222
+
<row>
223
+
<entry>7.4.0</entry>
224
+
<entry>
225
+
The values of the password algo IDs (<constant>PASSWORD_BCRYPT</constant>, <constant>PASSWORD_ARGON2I</constant>,
226
+
<constant>PASSWORD_ARGON2ID</constant> and <constant>PASSWORD_DEFAULT</constant>) are now &string;s.
227
+
Previously, they have been &integer;s.
228
+
</entry>
229
+
</row>
230
+
</tbody>
231
+
</tgroup>
232
+
</informaltable>
233
+
</para>
234
+
</formalpara>
235
+

166
236
</appendix>
167
237

168
238
<!-- Keep this comment at the end of the file
169
239