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.0.0.tar.gz
(5.2 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.0.0.tar.gz.
File metadata
- Download URL: async_argon2-1.0.0.tar.gz
- Upload date:
- Size: 5.2 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 |
ff7710622baab6bb9900137659c60e5cb496661c20e9c9a6d5b50b7ffa6627b6
|
|
| MD5 |
2b1b0667bc061d1eefe79f783be66c6c
|
|
| BLAKE2b-256 |
29f910d4444d1fddbdfeade33d6cc1777b5dcf8b6f1d4deb58ac5525f552f518
|
File details
Details for the file async_argon2-1.0.0-py3-none-any.whl.
File metadata
- Download URL: async_argon2-1.0.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 |
8e6eed14074532b48917f4fae9abfec872422a291455d112adeb41f3697b41a7
|
|
| MD5 |
637a5888d2ec056093b7343bde3ac152
|
|
| BLAKE2b-256 |
90faaa7d861a2dfb67db5bf42cca948a9cfe749eb1a6873380ccf355aa215342
|