Metadata-Version: 2.5
Name: antkit
Version: 0.0.3
Summary: Cryptographically secure tokens and passwords.
Project-URL: Homepage, https://pypi.org/project/antkit/
Author-email: lqxnjk <lqxnjk@qq.com>
License: MIT
License-File: LICENSE
Keywords: password,random,secrets,security,token
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# antkit

[English](#english) | 中文

密码学安全的随机 token 与口令生成。

## 安装

```console
pip install antkit
```

## 用法

```python
from antkit import password, token

token()                       # 22 字符，16 字节熵
token(n_bytes=32)
token(n_urlsafe=False)        # hex

password()                    # 16 位，四类字符全用
password(24, n_symbols=False)
password(12, n_lower=False, n_upper=False)
```

## 说明

全部基于 `secrets`，不用 `random`（它的种子可预测，不能用于任何不该被猜到的值）。口令保证每个启用的字符类至少出现一次，然后整体打乱，避免保底字符堆在开头。请求不可能满足时抛 `ValueError`。

## 许可证

MIT

---

<a id="english"></a>
## English

Cryptographically secure tokens and passwords.

## Install

```console
pip install antkit
```

## Usage

```python
from antkit import password, token

token()                       # 22 字符，16 字节熵
token(n_bytes=32)
token(n_urlsafe=False)        # hex

password()                    # 16 位，四类字符全用
password(24, n_symbols=False)
password(12, n_lower=False, n_upper=False)
```

## Notes

Built on `secrets`, never `random`. Passwords always contain at least one character from every enabled class, then get shuffled so the guaranteed characters are not stuck at the front. Impossible requests raise `ValueError`.

## License

MIT
