Skip to content

Commit 34f5d7f

Browse files
authored
Refactor spy function documentation for clarity (#1112)
fixes #1108 (reply in thread)
1 parent b11e7bf commit 34f5d7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/official-site/sqlpage/migrations/08_functions.sql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ VALUES (
157157
'0.7.2',
158158
'spy',
159159
'
160-
Hashes a password using the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm.
161-
The resulting hash can be stored in the database and then used with the [authentication component](documentation.sql?component=authentication#component).
160+
Hashes a password with the Argon2id variant and outputs it in the [PHC string format](https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md), ready to store in your users table.
161+
162+
Every call generates a brand new cryptographic salt so that two people choosing the same password still end up with different hashes, which defeats rainbow-table attacks and lets you safely reveal only the hash.
163+
164+
Use this function only when creating or resetting a password (for example while inserting a brand new user): it writes the stored value. Later, at login time, the [authentication component](documentation.sql?component=authentication#component) reads the stored hash, hashes the visitor''s password with the embedded salt and parameters, and grants access only if they match.
162165
163166
### Example
164167

0 commit comments

Comments
 (0)