Metadata-Version: 2.4
Name: async-argon2
Version: 1.1.0
Summary: An asynchronous wrapper on Argon2 that runs a CPU task in a separate thread.
Author-email: hotpotato89 <ramilreading@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Hotpotato89
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: argon2-cffi>=25.1.0
Requires-Dist: passlib>=1.7.4
Description-Content-Type: text/markdown

# AsyncArgon2

[![PyPI version](https://img.shields.io/pypi/v/async-argon2.svg)](https://pypi.org/project/async-argon2/)
[![License](https://img.shields.io/github/license/hotpotato89/async-argon2.svg)](https://github.com/hotpotato89/async-argon2/blob/main/LICENSE)
[![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](https://github.com/hotpotato89/async-argon2/actions)
[![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/hotpotato89/async-argon2)

Асинхронная обертка для хэширования паролей с Argon2.

[**Документация**](https://hotpotato89.github.io/async-argon2/)

## Установка

```bash
pip install async-argon2
```

## Использование

```python
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` запускает хэширование в отдельном потоке, не блокируя другие задачи.

```python
# ❌ Блокирует 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 свободен
```

## Кастомные параметры

```python
hasher = AsyncArgon2(
    time_cost=3,
    memory_cost=153600,
    parallelism=4,
)
```
