DevRivet Blog
Short, practical guides for everyday development work. Each one links to a free tool you can try right away in your browser.
encodeURIComponent vs encodeURI in JavaScript: Which to Use
Use encodeURIComponent for query values and path segments. encodeURI leaves reserved characters like & and / alone, so use it only on a complete URL.
· URL Encoder / Decoder
Base64 vs Base64URL: Differences and When to Use Each
Base64URL swaps + and / for - and _ and often drops = padding. Learn the differences, when each one fits, and how to convert between them.
· Base64 Encoder / Decoder
Base64 Size Increase: Why Base64 Makes Data About 33% Bigger
Base64 turns every 3 bytes into 4 ASCII characters, so the output is about 33% larger. Learn the size formula, plus how padding and line breaks add overhead.
· Base64 Encoder / Decoder
Are UUIDs Really Unique? UUID Collision Probability Explained
A random UUID v4 has 122 random bits, so a collision is practically impossible at normal scale. Here is the math, the real risks, and how to avoid them.
· UUID Generator
UUID v4 vs v7: Which Should You Use?
UUID v4 is random and reveals no timing. UUID v7 starts with a millisecond timestamp and sorts by creation time. Use v7 for primary keys, v4 for public IDs.
· UUID Generator
Get Current Unix Timestamp in JavaScript, Python and SQL
Get the current Unix timestamp in seconds or milliseconds in JavaScript, Python and SQL. One-line expressions for PostgreSQL, MySQL, SQLite and SQL Server.
· Unix Timestamp Converter
Unix Timestamp Seconds vs Milliseconds: How to Tell and Convert
Seconds timestamps have 10 digits, milliseconds have 13. Learn how to tell them apart and convert either to a date in JavaScript, Python and the shell.
· Unix Timestamp Converter
Decode JWT vs Verify: What's the Difference?
Decoding a JWT only reads its header and payload. Verifying checks the signature and claims with a trusted key. Here is how each works, with code.
· JWT Decoder
How to Check JWT Expiration Time (exp Claim)
The JWT exp claim is a Unix timestamp in seconds (UTC). Check it in JavaScript, Node.js and Python by decoding the payload and comparing exp with now.
· JWT Decoder
JavaScript Regex Named Groups: Syntax, Access and Replace
Name a JavaScript regex capture group with (?<name>...), read it from match.groups, and reference it with \k<name> or $<name>. Examples and pitfalls.
· Regex Tester
Unexpected Token in JSON at Position: Causes and Fixes
Unexpected token in JSON at position means JSON.parse hit a character it does not accept. Causes: HTML pages, trailing commas, single quotes, BOMs.
· JSON Formatter / Validator
Trailing Comma in JSON: Why JSON.parse Fails and How to Fix It
A trailing comma makes JSON invalid. See the exact JSON.parse and Python errors, how to find and remove the comma safely, and when trailing commas are allowed.
· JSON Formatter / Validator
Regex for Email Validation: Practical Patterns and Limits
A simple regex catches obvious email typos, but no regex fully validates RFC 5322. Here are practical patterns, their limits, and why to confirm by email.
· Regex Tester
Regex Phone Number Patterns for Common Formats
Use this regex to match common US and Canadian phone formats like (555) 123-4567 and +1 555.123.4567, plus extraction, E.164 and pitfalls.
· Regex Tester
Cron Expression for Every Monday (0 9 * * 1) and Weekly Schedules
Use 0 9 * * 1 to run a cron job every Monday at 9:00 AM. Examples for crontab, GitHub Actions, Kubernetes CronJob and Node.js, plus day-of-week numbering.
· Cron Expression Generator
Cron Expression for Every 5 Minutes (and Other Common Intervals)
The cron expression for every 5 minutes is */5 * * * *. Learn how step values work, how to limit runs to business hours, and the pitfalls of odd intervals.
· Cron Expression Generator
Cron Expression for Every Day at Midnight (0 0 * * *)
The cron expression for every day at midnight is 0 0 * * *. See it in crontab, GitHub Actions, Kubernetes CronJob and Node.js, plus timezone pitfalls.
· Cron Expression Generator