Add lib/hash and lib/secrets (EN/ZH) with known-vector golds, getrandom-backed tokens, and public demos. Co-authored-by: Cursor <cursoragent@cursor.com>
437 B
437 B
title, description
| title | description |
|---|---|
| lib/机密 | 安全随机令牌(中层 M3)。勿用 math.random 生成令牌。 |
十六进制令牌
+ `字节数`=None
字节长度(默认 16),返回长度为 2*字节数 的小写 hex。
> host_secrets_token_hex n=字节数
网址安全令牌
+ `字节数`=None
字节长度(默认 16),URL-safe Base64(无填充)。
> host_secrets_token_urlsafe n=字节数