cfw_argon2_available()
cfw_argon2_available() : bool
cfw_argon2_raw(string $password, string $salt, int $m, int $t, int $p, int $tagLen = 32) : string|false|null
| string | $password | The password bytes. |
| string | $salt | The salt bytes. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |
| int | $tagLen | Output length in bytes. |
The raw tag, FALSE when the reply was not base64, or NULL when the host refused.
cfw_argon2_hash(string $password, int $m = 19456, int $t = 2, int $p = 1) : string|null
Hashes into PHP's own encoded form.
| string | $password | The password to hash. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |
The encoded hash, or NULL when the host refused.
cfw_argon2_verify(string $password, string $encoded) : bool
Verifies against an encoded hash, in constant time.
hash_equals() rather than ===, because a byte-at-a-time comparison of a password digest is a timing oracle even when the digest itself is memory-hard.
| string | $password | The password to check. |
| string | $encoded | A hash cfw_argon2_hash() or PHP's own password_hash() wrote. |
cfw_argon2_needs_rehash(string $encoded, int $m = 19456, int $t = 2, int $p = 1) : bool
whether an existing encoded hash was written with weaker parameters than today's
| string | $encoded | The stored hash. |
| int | $m | Memory cost in KiB. |
| int | $t | Time cost. |
| int | $p | Lanes. |