Skip to content

Commit 8eb9405

Browse files
committed
docs: it's args and kwargs
1 parent abd18e5 commit 8eb9405

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ But it's way more comfortable to run it locally and *git* catching avoidable err
113113
"""
114114
Do something.
115115
116-
Parameters:
116+
Args:
117117
x: A very important parameter.
118118
119119
y:

src/argon2/_password_hasher.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PasswordHasher:
4040
parameters and to verify the parameters only *once*. Any unnecessary
4141
slowdown when hashing is a tangible advantage for a brute-force attacker.
4242
43-
Parameters:
43+
Args:
4444
time_cost:
4545
Defines the amount of computation realized and therefore the
4646
execution time, given in number of iterations.
@@ -162,10 +162,11 @@ def hash(self, password: str | bytes, *, salt: bytes | None = None) -> str:
162162
"""
163163
Hash *password* and return an encoded hash.
164164
165-
Parameters:
165+
Args:
166166
password: Password to hash.
167167
168-
salt: If None, a random salt is securely created.
168+
salt:
169+
If None, a random salt is securely created.
169170
170171
.. danger::
171172
@@ -208,7 +209,7 @@ def verify(
208209
other parsing than the determination of the hash type is done by
209210
*argon2-cffi*.
210211
211-
Parameters:
212+
Args:
212213
hash: An encoded hash as returned from :meth:`PasswordHasher.hash`.
213214
214215
password: The password to verify.
@@ -256,7 +257,7 @@ def check_needs_rehash(self, hash: str) -> bool:
256257
Therefore it's best practice to check -- and if necessary rehash --
257258
passwords after each successful authentication.
258259
259-
Parameters:
260+
Args:
260261
hash: An encoded Argon2 password hash.
261262
262263
Returns:

src/argon2/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def extract_parameters(hash: str) -> Parameters:
103103
"""
104104
Extract parameters from an encoded *hash*.
105105
106-
Parameters:
106+
Args:
107107
hash: An encoded Argon2 hash string.
108108
109109
Returns:

src/argon2/low_level.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ def hash_secret(
6666
An encoded hash can be directly passed into :func:`verify_secret` as it
6767
contains all parameters and the salt.
6868
69-
Parameters:
69+
Args:
7070
secret: Secret to hash.
7171
72-
salt:
73-
A salt_. Should be random and different for each secret.
72+
salt: A salt_. Should be random and different for each secret.
7473
7574
type: Which Argon2 variant to use.
7675
@@ -166,7 +165,7 @@ def verify_secret(hash: bytes, secret: bytes, type: Type) -> Literal[True]:
166165
"""
167166
Verify whether *secret* is correct for *hash* of *type*.
168167
169-
Parameters:
168+
Args:
170169
hash:
171170
An encoded Argon2 hash as returned by :func:`hash_secret`.
172171
@@ -179,6 +178,7 @@ def verify_secret(hash: bytes, secret: bytes, type: Type) -> Literal[True]:
179178
argon2.exceptions.VerifyMismatchError:
180179
If verification fails because *hash* is not valid for *secret* of
181180
*type*.
181+
182182
argon2.exceptions.VerificationError:
183183
If verification fails for other reasons.
184184
@@ -221,7 +221,7 @@ def core(context: Any, type: int) -> int:
221221
Use at your own peril; *argon2-cffi* does *not* use this binding
222222
itself.
223223
224-
Parameters:
224+
Args:
225225
context:
226226
A CFFI Argon2 context object (i.e. an ``struct Argon2_Context`` /
227227
``argon2_context``).
@@ -243,7 +243,7 @@ def error_to_str(error: int) -> str:
243243
"""
244244
Convert an Argon2 error code into a native string.
245245
246-
Parameters:
246+
Args:
247247
error: An Argon2 error code as returned by :func:`core`.
248248
249249
Returns:

0 commit comments

Comments
 (0)