Files
marqdo/lib/secrets.mq.md
T
cflmyandCursor 08384c7540 feat(stdlib): Mid M3 hash digests and secure tokens
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>
2026-09-07 20:15:36 +08:00

379 B

title, description
title description
lib/secrets Cryptographic tokens (Mid M3). Do not use math.random for secrets.

token_hex

+ `n`=None

Byte length n (default 16). Returns lowercase hex of length 2*n.

> host_secrets_token_hex n=n

token_urlsafe

+ `n`=None

Byte length n (default 16). URL-safe Base64 without padding.

> host_secrets_token_urlsafe n=n