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>
19 lines
437 B
Markdown
19 lines
437 B
Markdown
---
|
|
title: lib/机密
|
|
description: 安全随机令牌(中层 M3)。勿用 math.random 生成令牌。
|
|
---
|
|
|
|
## 十六进制令牌
|
|
+ `字节数`=None
|
|
|
|
字节长度(默认 16),返回长度为 `2*字节数` 的小写 hex。
|
|
|
|
**> host_secrets_token_hex n=`字节数`**
|
|
|
|
## 网址安全令牌
|
|
+ `字节数`=None
|
|
|
|
字节长度(默认 16),URL-safe Base64(无填充)。
|
|
|
|
**> host_secrets_token_urlsafe n=`字节数`**
|