Skip to content

Commit

Permalink
docs: it's args and kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Feb 6, 2024
1 parent abd18e5 commit 8eb9405
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ But it's way more comfortable to run it locally and *git* catching avoidable err
"""
Do something.
Parameters:
Args:
x: A very important parameter.
y:
Expand Down
11 changes: 6 additions & 5 deletions src/argon2/_password_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PasswordHasher:
parameters and to verify the parameters only *once*. Any unnecessary
slowdown when hashing is a tangible advantage for a brute-force attacker.
Parameters:
Args:
time_cost:
Defines the amount of computation realized and therefore the
execution time, given in number of iterations.
Expand Down Expand Up @@ -162,10 +162,11 @@ def hash(self, password: str | bytes, *, salt: bytes | None = None) -> str:
"""
Hash *password* and return an encoded hash.
Parameters:
Args:
password: Password to hash.
salt: If None, a random salt is securely created.
salt:
If None, a random salt is securely created.
.. danger::
Expand Down Expand Up @@ -208,7 +209,7 @@ def verify(
other parsing than the determination of the hash type is done by
*argon2-cffi*.
Parameters:
Args:
hash: An encoded hash as returned from :meth:`PasswordHasher.hash`.
password: The password to verify.
Expand Down Expand Up @@ -256,7 +257,7 @@ def check_needs_rehash(self, hash: str) -> bool:
Therefore it's best practice to check -- and if necessary rehash --
passwords after each successful authentication.
Parameters:
Args:
hash: An encoded Argon2 password hash.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion src/argon2/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def extract_parameters(hash: str) -> Parameters:
"""
Extract parameters from an encoded *hash*.
Parameters:
Args:
hash: An encoded Argon2 hash string.
Returns:
Expand Down
12 changes: 6 additions & 6 deletions src/argon2/low_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ def hash_secret(
An encoded hash can be directly passed into :func:`verify_secret` as it
contains all parameters and the salt.
Parameters:
Args:
secret: Secret to hash.
salt:
A salt_. Should be random and different for each secret.
salt: A salt_. Should be random and different for each secret.
type: Which Argon2 variant to use.
Expand Down Expand Up @@ -166,7 +165,7 @@ def verify_secret(hash: bytes, secret: bytes, type: Type) -> Literal[True]:
"""
Verify whether *secret* is correct for *hash* of *type*.
Parameters:
Args:
hash:
An encoded Argon2 hash as returned by :func:`hash_secret`.
Expand All @@ -179,6 +178,7 @@ def verify_secret(hash: bytes, secret: bytes, type: Type) -> Literal[True]:
argon2.exceptions.VerifyMismatchError:
If verification fails because *hash* is not valid for *secret* of
*type*.
argon2.exceptions.VerificationError:
If verification fails for other reasons.
Expand Down Expand Up @@ -221,7 +221,7 @@ def core(context: Any, type: int) -> int:
Use at your own peril; *argon2-cffi* does *not* use this binding
itself.
Parameters:
Args:
context:
A CFFI Argon2 context object (i.e. an ``struct Argon2_Context`` /
``argon2_context``).
Expand All @@ -243,7 +243,7 @@ def error_to_str(error: int) -> str:
"""
Convert an Argon2 error code into a native string.
Parameters:
Args:
error: An Argon2 error code as returned by :func:`core`.
Returns:
Expand Down

0 comments on commit 8eb9405

Please sign in to comment.