Skip to content

feat: use URL-safe base64url encoding for shareable links#50

Merged
konard merged 3 commits intomainfrom
issue-49-3b507ada7087
Jan 29, 2026
Merged

feat: use URL-safe base64url encoding for shareable links#50
konard merged 3 commits intomainfrom
issue-49-3b507ada7087

Conversation

@konard
Copy link
Contributor

@konard konard commented Jan 29, 2026

Summary

  • Replace standard base64 URL encoding with URL-safe base64url encoding (RFC 4648 Section 5)
  • URLs now use only a-zA-Z0-9, -, and _ characters - no more ugly URL encoding like %3D for =
  • Auto-calculate when expression is loaded from URL (calculation triggered immediately)
  • Backward compatibility: old base64 URLs are automatically redirected to new format
  • Prevent duplicate browser history entries when same expression is recalculated

Technical Details

The new encoding:

  • Converts + to -
  • Converts / to _
  • Removes padding =

This makes URLs shorter and cleaner while maintaining full backward compatibility with existing shared links.

Test plan

  • Run unit tests (npm test in web/)
  • Run Rust tests (cargo test)
  • Run linting checks (cargo fmt --check && cargo clippy)
  • Verify new encoding produces only URL-safe characters
  • Verify old base64 URLs still decode correctly
  • Verify auto-redirect from old format to new format
  • Verify calculation triggers automatically on URL load
  • Verify no duplicate history entries on recalculation

Fixes #49

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #49
@konard konard self-assigned this Jan 29, 2026
Replace standard base64 encoding with base64url (RFC 4648 Section 5) for URL
parameters. This change:

- Uses only a-zA-Z0-9, -, _ characters (no URL encoding needed)
- Removes padding = characters that caused ugly URL encoding
- Maintains backward compatibility with old base64 URLs (auto-redirect)
- Auto-calculates when expression is loaded from URL
- Prevents duplicate browser history entries

Fixes #49

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Update link generation so it does not include base64 by default feat: use URL-safe base64url encoding for shareable links Jan 29, 2026
@konard konard marked this pull request as ready for review January 29, 2026 12:55
@konard
Copy link
Contributor Author

konard commented Jan 29, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.207786 USD
  • Calculated by Anthropic: $2.070887 USD
  • Difference: $-1.136899 (-35.44%)
    📎 Log file uploaded as Gist (481KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit c062fbe into main Jan 29, 2026
12 checks passed
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.

Update link generation so it does not include base64 by default

1 participant