Metadata-Version: 2.4
Name: secrets-plus
Version: 0.1.0
Summary: Windows BCrypt 加密安全随机数C扩展，与secrets接口完全一致
Author: Tevend_geven
Author-email: yanxiao_feng2013@163.com
License: MIT
Platform: Windows
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Security :: Cryptography
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: platform
Dynamic: requires-python
Dynamic: summary

# token-gen-win
Windows平台专用高性能C扩展，基于系统原生 **BCrypt API** 实现加密安全随机数，完整复刻Python标准库 `secrets` 常用接口，性能优于原生Python实现。

## 平台限制
**仅支持 Windows 系统**
Linux / macOS 无系统BCrypt依赖库，无法编译、安装。

## 功能列表
完全对齐标准库 secrets 接口：
- `token_bytes()`：生成随机字节串
- `token_hex()`：生成十六进制随机令牌
- `token_urlsafe()`：生成URL安全随机令牌
- `randbelow()`：生成指定上界安全随机整数
- `randbits()`：生成指定比特位随机数
- `choice()`：从序列随机选取元素
- `shuffle()`：原地随机打乱序列

## 安装方式
```bash
pip install token-gen
```

## 快速使用
```python
import token_gen

# 生成各类安全令牌
print(token_gen.token_urlsafe())
print(token_gen.token_hex(16))
print(token_gen.token_bytes(32))

# 随机数工具
print(token_gen.randbelow(1000))
print(token_gen.randbits(12))

# 序列操作
lst = [1,2,3,4,5]
print(token_gen.choice(lst))
token_gen.shuffle(lst)
print(lst)
```

## 注意事项
1. 基于栈分配实现，不支持超大长度随机数生成（建议单次长度不超过1024），避免栈溢出
2. 长期后台运行存在轻微BCrypt句柄残留，短期脚本使用无任何影响
