Skip to content

feat: mint share tokens in the same hex style as note ids#320

Merged
fjbarrett merged 1 commit into
mainfrom
feat/share-token-note-id-style
Jul 10, 2026
Merged

feat: mint share tokens in the same hex style as note ids#320
fjbarrett merged 1 commit into
mainfrom
feat/share-token-note-id-style

Conversation

@fjbarrett

Copy link
Copy Markdown
Owner

Summary

  • newShareToken() now returns 32 lowercase hex chars (randomBytes(16).toString("hex")) instead of 22-char base64url, so /p/<token> share links look like /note/<id> links
  • Entropy unchanged (128 bits); existing base64url tokens keep resolving (exact-match lookup); vanity tokens unaffected
  • Updated the identifier-format test

Test plan

  • npm test — 125/125
  • npx tsc --noEmit clean

🤖 Generated with Claude Code

Share links now read like note links (/p/<32-hex> vs /note/<32-hex>)
instead of standing out as 22-char base64url. Entropy is unchanged at
128 bits, and existing tokens keep resolving since lookups are exact
string matches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fjbarrett
fjbarrett merged commit 71466a1 into main Jul 10, 2026
3 checks passed
@fjbarrett
fjbarrett deleted the feat/share-token-note-id-style branch July 10, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant