SShortSingh.
Back to feed

Building a TAR archive in the browser with about 100 lines of TypeScript

0
·18 views

A developer explains how to write TAR files by hand in the browser, arguing the format is simple enough to be a good learning exercise compared with the more common ZIP. A TAR archive is a series of 512-byte blocks, with a header per file, zero-padded data, and two empty blocks at the end, and it has no compression or index of its own. The header uses ASCII octal numbers and includes a checksum computed with that field treated as spaces. The approach wraps File objects in a Blob without loading them into memory, so large inputs stay manageable. The author notes edge cases such as names longer than 100 bytes, UTF-8 byte lengths, and directory entries, and says the browser's built-in gzip support can produce .tar.gz output.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Python Basics for Class 10 AI: Functions, Keywords and Data Types Explained

A DEV Community tutorial introduces Python to Class 10 students as part of the Artificial Intelligence syllabus, where it now features prominently. The author, who admits to having disliked Python, promises to build up from the absolute basics. It explains core terms such as programming languages, data, and data types, including integers and strings. The piece walks readers through writing functions with def, parameters, return values, and indentation, using a simple addition example. It also covers variables and reserved keywords to show how Python interprets code consistently.

0
ProgrammingDEV Community ·

Siemens Mendix flaw CVE-2026-124981 allows session hijacking via token identifiers

A vulnerability tracked as CVE-2026-124981 has been assigned a CVSS 4.0 score of 9.4 and a CVSS 3.1 score of 8.7, indicating serious risk. Siemens describes the flaw as remotely exploitable without authentication, enabling an attacker to hijack an account session if they know an active token's jti value. The advisory does not confirm that jti values can be guessed or that attacks are occurring in the wild. Experts advise ranking affected Mendix applications by factors such as confirmed module versions, internet exposure, and the data and privileges accessible to session users. They also recommend deploying the vendor fix promptly, with interim measures like independent JWT signature validation where patching is delayed.

0
ProgrammingDEV Community ·

Game Patch Review Tool Adds Moderated Chatbot Using LLM JSON Schema Validation

A developer guide outlines how to add basic safety moderation to an in-app chatbot that reviews game patches. It recommends a chat API with an LLM JSON schema, paired with a separate classification prompt and server-side validation. The proposed contract uses an allow, block, or review decision plus a findings array, so an empty result cannot be ambiguous. The guide also stresses checking that finding line references match the submitted diff, since schema-valid output can still be wrong. It argues that schema conformity alone does not prove a reported issue is real or that a safety label is accurate.

0
ProgrammingDEV Community ·

Nvdriver, driver clean-room de Nvidia en Rust, llega a su versión 0.1.0

Nvdriver es un driver de kernel para GPUs Nvidia en Linux, escrito en Rust y desarrollado sin acceso al código fuente de Nvidia, a partir del comportamiento observable del hardware y del driver propietario. Su primera versión publicada, la v0.1.0, apareció el 29 de noviembre de 2026. El proyecto busca mantener compatibilidad con software como CUDA, PyTorch, cuDNN y nvidia-smi, sin modificaciones, y reemplazar restricciones por software que, según sus autores, no dependen del silicio. Entre ellas menciona límites de reloj de memoria, sesiones de NVENC y restricciones de virtualización, aunque estas afirmaciones provienen de la documentación del propio proyecto y no fueron verificadas de forma independiente.