All help topics · Link to this topic
Showing help on 'argon2()'
Syntax: argon2 (STR <password>, STR <salt> [, <iterations> 3] [, <memory usage in KB> 4096] [, <CPU threads> 1]) => STRThe function `argon2()' hashes a password using the Argon2id password hashing algorithm. The programmer must be a wizard, or E_PERM is raised. It is parametrized by three optional arguments:
* Time: This is the number of times the hash will get run. This defines the amount of computation required and, as a result, how long the function will take to complete.
* Memory: This is how much RAM is reserved for hashing.
* Parallelism: This is the number of CPU threads that will run in parallel.
The salt for the password should, at minimum, be 16 bytes for password hashing. It is recommended to use the random_bytes() function.