We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2e9d25 commit e07f4d1Copy full SHA for e07f4d1
ciphers/sha256.py
@@ -210,7 +210,7 @@ def int_to_big_endian_bytes(value: int) -> bytes:
210
# =============================================================================
211
212
213
-def is_prime(n: int) -> bool:
+def is_prime(num_to_test: int) -> bool:
214
"""
215
Returns True if n is a prime number.
216
Uses trial division up to floor(sqrt(n)).
@@ -227,9 +227,9 @@ def is_prime(n: int) -> bool:
227
>>> is_prime(0)
228
False
229
230
- if n < 2:
+ if num_to_test < 2:
231
return False
232
- return all(n % f != 0 for f in range(2, math.isqrt(n) + 1))
+ return all(num_to_test % f != 0 for f in range(2, math.isqrt(num_to_test) + 1))
233
234
235
def first_n_primes(count_primes: int):
0 commit comments