Xerobit

Guides · page 5 of 5

Browsing 107 guides, newest first.

Encoding & Crypto

JWT Decode vs Verify: Error Messages, alg none and Safe Library Code

Decoding a JWT proves nothing. Tested jsonwebtoken, PyJWT and jose errors for alg none, HS/RS confusion, expired and bad-signature tokens, plus safe verify code.

8 min read
Encoding & Crypto

Migrate MD5 Password Hashes to bcrypt or Argon2 Without Forcing a Reset

You have an MD5 password column and no plaintexts. Wrap every hash in bcrypt today, upgrade on next login, tested in Node and Python with a hash_algo column.

7 min read
Dev Productivity

Regex Differences Between JavaScript, Python and PCRE (Side-by-Side Table)

24 regex features run in JavaScript, Python re, Python regex, Perl and RE2: named groups, lookbehind, possessive quantifiers, \Z, Unicode, replacement syntax, backtracking.

9 min read
Dev Productivity

Timestamp Off by One Day or One Hour? DST, UTC Midnight and JS Date

Why a date shows the day before or an hour early: JS Date parsing, UTC midnight queries and 23-hour DST days, with outputs from Node, Python and Chrome and the fixes.

7 min read
Encoding & Crypto

URL Encoding Bugs: Plus vs %20, encodeURI, Fragments and UTF-8 Fixes

Seven URL encoding bugs with exact input, wrong output and right output, tested in JavaScript, Python and curl: plus becoming a space, encodeURI misuse, # truncation, UTF-8 errors.

8 min read
Encoding & Crypto

UUID v4 vs v7 as a Primary Key: A Measured Postgres Benchmark

Measured on PostgreSQL 16: inserting 1M and 5M rows with UUID v4, UUID v7 and bigint keys. Insert time, index size, index bloat and WAL, with the script to rerun it.

7 min read
Dev Productivity

Fix a Failing Color Contrast Ratio Without Changing Your Brand Color

Brand color failing WCAG AA? Tested table of six common UI colors with ratios on white and dark, the smallest darker shade that passes 4.5:1 and 3:1, plus axe checks for CI.

8 min read
Encoding & Crypto

Base64 Data URIs in HTML and CSS: Size Overhead, Caching and When to Inline

Measured cost of base64 data URIs: the 33% size overhead, why gzip hides most of it, the caching and render-blocking costs in CSS, and where inlining still pays off.

6 min read
Dev Productivity

400 or 422 for Validation Errors? Tested Defaults in FastAPI, DRF, ASP.NET, Express

400 or 422 for a validation error? Tested defaults of FastAPI, Django REST Framework, ASP.NET Core and Express, a decision rule, RFC 9457 error bodies and a fetch wrapper.

8 min read
Data & Format

The YAML Norway Problem: Why NO Becomes false (and 5 Other Implicit Type Traps)

country: NO loads as false in PyYAML but stays a string in js-yaml and ruamel. A tested table of NO, yes, 0123, 22:22, 1.10 and dates across four parsers, with fixes.

8 min read
Data & Format

JSON Validation Errors: Syntax, Data and Schema Causes

Why JSON fails validation, by cause: 20 syntax mistakes with real Node and Python messages, silent data traps like big integers, and Ajv schema errors with fixes.

9 min read