AsyncArgon2
Асинхронная обертка для хэширования паролей с Argon2.
Установка
pip install async-argon2
Использование
import asyncio
from async_argon2 import AsyncArgon2
hasher = AsyncArgon2()
async def main():
hashed = await hasher.hash("password123")
print(hashed)
is_valid = await hasher.verify("password123", hashed)
print(is_valid) # True
asyncio.run(main())
Почему AsyncArgon2?
Синхронный Argon2 блокирует event loop. AsyncArgon2 запускает хэширование в отдельном потоке, не блокируя другие задачи.
# ❌ Блокирует event loop
from argon2 import PasswordHasher
hasher = PasswordHasher()
hashed = hasher.hash("password") # Все ждут!
# ✅ Не блокирует
from async_argon2 import AsyncArgon2
hasher = AsyncArgon2()
hashed = await hasher.hash("password") # Event loop свободен
Кастомные параметры
hasher = AsyncArgon2(
time_cost=3,
memory_cost=153600,
parallelism=4,
)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
async_argon2-1.1.0.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async_argon2-1.1.0.tar.gz.
File metadata
- Download URL: async_argon2-1.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
355b2f31b2b4bd21cf7e93c31e57a78a86deaf181e056d18cd9869458178b2a4
|
|
| MD5 |
60a198b14b19183bc297e065749a1779
|
|
| BLAKE2b-256 |
880222c66ae2f41808695effd2955d3ab2ca06bbcba92cd733b9a63be56b2d27
|
File details
Details for the file async_argon2-1.1.0-py3-none-any.whl.
File metadata
- Download URL: async_argon2-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e42d7b66041bbc0e16b7f5fab0181c0d27f0ca5088558c81d7f2f4962c2c2c06
|
|
| MD5 |
97c99799322c315b08b1bdc6d3639097
|
|
| BLAKE2b-256 |
b1077862783ff63dc3201a7ec69acc6203faf2be63c707946c2f753b31737b32
|