Skip to content

Add Base64 and ROT-N encoding/decoding tools - #5

Merged
akx merged 4 commits into
masterfrom
claude/add-base64-tool-3unfH
Mar 29, 2026
Merged

Add Base64 and ROT-N encoding/decoding tools#5
akx merged 4 commits into
masterfrom
claude/add-base64-tool-3unfH

Conversation

@akx

@akx akx commented Mar 29, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds two new utility tools to the toys collection: a Base64 encoder/decoder and a ROT-N cipher tool. Both tools provide interactive interfaces for text transformation with copy-to-clipboard functionality.

Key Changes

  • Base64 Tool (src/toys/base64/index.tsx):

    • Encode plain text to Base64 and decode Base64 back to text
    • Support for URL-safe Base64 encoding (replacing + with -, / with _, and removing padding)
    • Error handling for invalid inputs
    • Copy output to clipboard with toast notification
  • ROT-N Tool (src/toys/rot-n/index.tsx):

    • Rotate alphabetic characters by N positions (Caesar cipher variant)
    • Support for both uppercase and lowercase letters
    • Real-time output as user types
    • Configurable rotation value (0-25) with quick reset to ROT-13
    • Copy output to clipboard with toast notification

Implementation Details

  • Both tools follow the existing toy component pattern with ToyMainBox and ToyMainBoxesContainer layout
  • Proper error handling in Base64 tool for encoding/decoding failures
  • ROT-N uses memoization to optimize output calculation
  • Consistent UI with disabled copy buttons when output is empty or invalid
  • Both tools use the useTitle hook to set page title

https://claude.ai/code/session_011MTZ8obwiV4LMLcSPDtM75

claude added 2 commits March 29, 2026 19:19
Supports standard and URL-safe base64, handles full UTF-8 via
TextEncoder/TextDecoder.

https://claude.ai/code/session_011MTZ8obwiV4LMLcSPDtM75
Live-updates output as you type. Handles uppercase, lowercase,
and passes non-alpha characters through unchanged.

https://claude.ai/code/session_011MTZ8obwiV4LMLcSPDtM75
@akx
akx marked this pull request as ready for review March 29, 2026 19:21
claude added 2 commits March 29, 2026 19:26
Use replaceAll, codePointAt/fromCodePoint, and catch-error-name
convention to satisfy unicorn eslint rules.

https://claude.ai/code/session_011MTZ8obwiV4LMLcSPDtM75
Rename export to rotNToy to avoid clashing with the rotN helper function.

https://claude.ai/code/session_011MTZ8obwiV4LMLcSPDtM75
@akx
akx merged commit 64370ae into master Mar 29, 2026
2 checks passed
@akx
akx deleted the claude/add-base64-tool-3unfH branch March 29, 2026 19:36
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.

2 participants