Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHESPTRUFRDEEN

Elysia Tools

Navigation

Network Protocols

QUIC offline wire-format exercises

Executable RFC 9000 integer, STREAM-frame and stream-ID exercises.

Samples

Entries inside this sample collection

CodejavascriptSimple

Check RFC variable integers

Four fixed RFC vectors decode and re-encode exactly, including 151288809941952652 with BigInt. Non-minimal 37 decodes; truncation and 2^62 are rejected.

javascript
import assert from 'node:assert/strict';
function readVarint(bytes, offset = 0) {
  if (offset >= bytes.length) throw new RangeError('truncated');
  const size = 1 << (bytes[offset] >> 6);
  if (offset + size > bytes.length) throw new RangeError('truncated');
  let value = BigInt(bytes[offset] & 63);
  for (let i = 1; i < size; i++) value = (value << 8n) | BigInt(bytes[offset+i]);
  return { value, next: offset + size };
}
function writeVarint(value) {
  if (typeof value !== 'bigint' || value < 0n || value >= (1n << 62n)) throw new RangeError('range');
  const size = value < 64n ? 1 : value < 16384n ? 2 : value < 1073741824n ? 4 : 8;
  const bytes = new Uint8Array(size); let n = value;
  for (let i = size-1; i >= 0; i--) { bytes[i] = Number(n & 255n); n >>= 8n; }
  bytes[0] |= ({1:0, 2:1, 4:2, 8:3}[size] << 6);
  return bytes;
}
// RFC 9000 Appendix A.1 fixed vectors, not a self-only round trip.
const vectors = [['25',37n],['7bbd',15293n],['9d7f3e7d',494878333n],['c2197c5eff14e88c',151288809941952652n]];
for (const [hex, value] of vectors) {
  assert.equal(readVarint(Buffer.from(hex,'hex')).value,value);
  assert.equal(Buffer.from(writeVarint(value)).toString('hex'),hex);
}
assert.equal(readVarint(Buffer.from('4025','hex')).value,37n); // valid non-minimal encoding
assert.throws(()=>readVarint(Uint8Array.of(0x40)),/truncated/);
assert.throws(()=>writeVarint(1n<<62n),/range/);
console.log('4 RFC vectors; non-minimal 37; truncated/range rejected');
runtime
Node.js 24.22.1
execution
offline authored fixtures
dependencies
{}
CodejavascriptIntermediate

Parse a plaintext STREAM frame

0b0003616263 describes stream 0, offset 0, FIN and three bytes abc. A truncated payload is rejected. This is a frame payload, not an encrypted QUIC packet.

javascript
import assert from 'node:assert/strict';
function readVarint(bytes, offset = 0) {
  if (offset >= bytes.length) throw new RangeError('truncated');
  const size = 1 << (bytes[offset] >> 6);
  if (offset + size > bytes.length) throw new RangeError('truncated');
  let value = BigInt(bytes[offset] & 63);
  for (let i = 1; i < size; i++) value = (value << 8n) | BigInt(bytes[offset+i]);
  return { value, next: offset + size };
}
function writeVarint(value) {
  if (typeof value !== 'bigint' || value < 0n || value >= (1n << 62n)) throw new RangeError('range');
  const size = value < 64n ? 1 : value < 16384n ? 2 : value < 1073741824n ? 4 : 8;
  const bytes = new Uint8Array(size); let n = value;
  for (let i = size-1; i >= 0; i--) { bytes[i] = Number(n & 255n); n >>= 8n; }
  bytes[0] |= ({1:0, 2:1, 4:2, 8:3}[size] << 6);
  return bytes;
}
// One plaintext STREAM frame only: not a packet, TLS or QUIC connection.
function parseStream(bytes) {
  let cursor=readVarint(bytes); const type=cursor.value;
  if (type<8n || type>15n) throw new Error('not STREAM');
  const take=()=>{const r=readVarint(bytes,cursor.next);cursor=r;return r.value;};
  const streamId=take(); const offset=(type&4n)?take():0n;
  const length=(type&2n)?take():BigInt(bytes.length-cursor.next);
  if(length>BigInt(bytes.length-cursor.next))throw new RangeError('truncated data');
  if(offset+length>=(1n<<62n))throw new RangeError('final size');
  const end=cursor.next+Number(length);
  return {streamId,offset,fin:Boolean(type&1n),data:bytes.slice(cursor.next,end),next:end};
}
const frame=Uint8Array.of(0x0b,0,3,0x61,0x62,0x63); // LEN+FIN, stream 0, offset absent
const r=parseStream(frame);
assert.deepEqual([r.streamId,r.offset,r.fin,r.next],[0n,0n,true,6]);
assert.equal(Buffer.from(r.data).toString(),'abc');
assert.throws(()=>parseStream(frame.slice(0,-1)),/truncated/);
const noLen=parseStream(Uint8Array.of(0x08,4,0x78));
assert.deepEqual([noLen.streamId,noLen.data.length,noLen.fin],[4n,1,false]);
console.log('STREAM 0: offset 0, FIN true, 3 bytes; truncation rejected');
runtime
Node.js 24.22.1
execution
offline authored fixtures
dependencies
{}
CodejavascriptComplex

Classify stream IDs

IDs 0–3 cover the four initiator/direction combinations. ID 8 is client-initiated bidirectional, ordinal 2. No stream is opened.

javascript
import assert from 'node:assert/strict';
// RFC 9000 section 2.1: classification only, no stream is opened.
function classify(id) {
  if(typeof id!=='bigint'||id<0n||id>=(1n<<62n))throw new RangeError('stream id');
  return {initiator:(id&1n)?'server':'client',direction:(id&2n)?'unidirectional':'bidirectional',ordinal:id>>2n};
}
assert.deepEqual([0n,1n,2n,3n].map(classify).map(x=>x.initiator+'/'+x.direction),[
 'client/bidirectional','server/bidirectional','client/unidirectional','server/unidirectional']);
assert.deepEqual(classify(8n),{initiator:'client',direction:'bidirectional',ordinal:2n});
assert.throws(()=>classify(-1n),/stream id/);
console.log('IDs 0..3: four types; ID 8: client bidirectional ordinal 2');
runtime
Node.js 24.22.1
execution
offline authored fixtures
dependencies
{}

Tools

Tools frequently paired with this sample

Related

Related sample collections

Related

Related workflows

Tool usage guide

Sample-focused context for search and workflow understanding

Overview

Executable RFC 9000 integer, STREAM-frame and stream-ID exercises. Offline teaching scope: no live service, broker, real authentication, encryption handshake or production guarantee. Protocol snippets implement only their named subset.

Tested cards

Save each independent card as caseN.mjs and run node caseN.mjs with Node 24. Install only the exact dependencies stated in the card, if any. Assertions must pass before changing the fixtures.

Tested cards
CardOutcome
Check RFC variable integersFour fixed RFC vectors decode and re-encode exactly, including 151288809941952652 with BigInt. Non-minimal 37 decodes; truncation and 2^62 are rejected.
Parse a plaintext STREAM frame0b0003616263 describes stream 0, offset 0, FIN and three bytes abc. A truncated payload is rejected. This is a frame payload, not an encrypted QUIC packet.
Classify stream IDsIDs 0–3 cover the four initiator/direction combinations. ID 8 is client-initiated bidirectional, ordinal 2. No stream is opened.

How it works

  1. 1Save each independent card as caseN.mjs and run node caseN.mjs with Node 24. Install only the exact dependencies stated in the card, if any. Assertions must pass before changing the fixtures.

Edge cases & common failures

  • Scope

    Offline teaching scope: no live service, broker, real authentication, encryption handshake or production guarantee. Protocol snippets implement only their named subset.

Examples

1. Check RFC variable integers

How to use

«Check RFC variable integers» — Save each independent card as caseN.mjs and run node caseN.mjs with Node 24. Install only the exact dependencies stated in the card, if any. Assertions must pass before changing the fixtures.

Outcome

Four fixed RFC vectors decode and re-encode exactly, including 151288809941952652 with BigInt. Non-minimal 37 decodes; truncation and 2^62 are rejected.

2. Parse a plaintext STREAM frame

How to use

«Parse a plaintext STREAM frame» — Save each independent card as caseN.mjs and run node caseN.mjs with Node 24. Install only the exact dependencies stated in the card, if any. Assertions must pass before changing the fixtures.

Outcome

0b0003616263 describes stream 0, offset 0, FIN and three bytes abc. A truncated payload is rejected. This is a frame payload, not an encrypted QUIC packet.

3. Classify stream IDs

How to use

«Classify stream IDs» — Save each independent card as caseN.mjs and run node caseN.mjs with Node 24. Install only the exact dependencies stated in the card, if any. Assertions must pass before changing the fixtures.

Outcome

IDs 0–3 cover the four initiator/direction combinations. ID 8 is client-initiated bidirectional, ordinal 2. No stream is opened.

Hub

Infer JSON Schema from Samples and Spreadsheets

Derive a reviewable JSON Schema draft from representative JSON samples or XLSX rows, then inspect types, requiredness, nulls, and outliers before treating it as a contract.

Hub

Network Triage, Packet Inspection, and Endpoint Debugging

Inspect captures, replay webhooks, validate addresses and CIDR ranges, check DNS, WHOIS, hosts files, TLS, and user agents, then record a focused network diagnosis.

Hub

Classic Browser Games and Quick Puzzles

Pick an instant browser game for a short break, from 2048 and Minesweeper to trivia and two-player classics.

Hub

Network Infrastructure Identifier Format Checks

Check IPv4 and IPv6 addresses, CIDR values, MAC addresses, AWS ARNs, and Docker image references before downstream processing, while keeping format evidence separate from reachability, ownership, permissions, and image availability.

Home
Tools3215
Samples593
Visualizations472
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web194

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact

Network

HTTP/3 QUIC Handshake Anatomy

Dissect the HTTP/3 over QUIC handshake byte-by-byte. Visualise the 1-RTT fresh handshake, session-ticket resumption, and 0-RTT early-data scenarios, with sequence diagrams, per-packet field layouts, the Retry packet, and a side-by-side comparison against TCP + TLS 1.3. Built for interview prep, protocol learning, and performance engineering.

Media

MIDI 1.0 / MIDI 2.0 UMP Universal MIDI Packet, Channel Voice 2.0, SysEx 7/8-bit Wire-Protocol Decoder & Byte Counter

Decode a MIDI 1.0 bytestream (status bytes, running status, System Common / Real Time, System Exclusive) or a MIDI 2.0 Universal MIDI Packet stream — message types 0x0 Utility, 0x1 System, 0x2 MIDI 1.0 Channel Voice, 0x3 SysEx 7-bit, 0x4 MIDI 2.0 Channel Voice with 16-bit velocity and the 7.9 pitch attribute, 0x5 SysEx 8-bit / Mixed Data, 0xD Flex Data, 0xF UMP Stream — with per-packet field tables, byte/word/packet counts, reserved-field validation, SysEx continuation state machines, and MIDI 1.0 ⇄ UMP translation.

Network

BGP Community Regex Tester and Looking-Glass Explainer

Validate RFC 8294 BGP community regex patterns against a set of communities, match sample AS-paths, and generate Cisco/Juniper/FRR route-policy output.

Network

DNS Query Tool

Query DNS records and domain resolution information including A, AAAA, MX, TXT, NS, and CNAME records

Network

DNS Zone File Record Builder

Build RFC 1035 DNS zone files (SOA + NS/A/AAAA/CNAME/MX/TXT/SRV/CAA/TLSA/NAPTR/DS) with per-record validation and a readable summary.

Math & Numbers

Graph Shortest Path (Dijkstra Step-By-Step)

Dijkstra with a full per-iteration trace: settled nodes, relaxations, distance table, and the final path; undirected or directed, negative weights rejected, unreachable targets reported.

Network

Integer to IPv4

Convert integers to IPv4 addresses. Supports batch conversion of multiple integers.

Network

Integer to IPv6

Convert integers (128-bit) to IPv6 addresses. Supports batch conversion.

Media

Copyright-Free MP3 Audio Samples

Collection of royalty-free audio samples for testing and development purposes including nature sounds, meditation music, and ambient audio

Document

PDF Samples

Generated PDF samples from tools dated 2026-02-01 to 2026-02-10

Testing

BDD with Cucumber - Behavior Driven Development

Comprehensive Cucumber BDD examples including feature files, step definitions, data tables, hooks, and advanced BDD patterns for collaborative development

Observability

Distributed Tracing Samples

Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture

DevOps

ELK Stack Log Analysis Samples

Comprehensive ELK Stack (Elasticsearch, Logstash, Kibana) samples for log aggregation, processing, and visualization in distributed systems

Testing

GitHub Actions Testing - CI/CD Integration

Comprehensive GitHub Actions testing workflows including automated testing, parallel execution, test reporting, caching, and advanced CI/CD patterns for modern development pipelines