SShortSingh.
Back to feed

How a duplicate file finder skips hashing most of your disk using three filters

0
·1 views

A common approach to finding duplicate files is to hash every file, but this is slow: a 1.09 GB test folder took about 21 seconds, which would scale to roughly three hours on a 500 GB drive. The solution described is not a faster hash but avoiding reading most bytes at all. Files are first grouped by size using metadata, since files of different sizes cannot be identical, and only size groups with multiple members continue. Remaining candidates are then checked by hashing just their first 4 KB, with full hashing reserved for those that still match. The article also covers handling hard links via inode identifiers and working around Windows path-length limits.

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 ·

Fable/Mythos 5.2: lower prices and long-running agent tasks signal a shift for coding models

The article examines Fable/Mythos 5.2, a coding-focused model release that appears designed for long, multi-step workloads rather than isolated snippets. Fable carries tighter guardrails, while Mythos is a more permissive profile aimed at enterprise settings with structured security processes. The announced pricing drops to $8 input and $40 output, and the suggested approach is a stable general model for routine tasks, reserving the more powerful model for demanding burst work. Demonstrations include swarms of around 1,000 sub-agents and an attempt to build a bootable operating system from an empty folder, which the author presents as signs of greater coherence over large projects. The piece argues that benchmark numbers matter less than how such models handle real, verifiable engineering constraints.

0
ProgrammingDEV Community ·

Open-source React component edits DOCX, XLSX and PPTX files in the browser without a server

A developer released an MIT-licensed React component that opens and edits Word, Excel and PowerPoint files directly in the browser. The author built it to avoid running a document server or relying on view-only libraries that struggle with large spreadsheets. According to the post, the engine streams files lazily and parses XML in a Web Worker, so a 300,000-row sheet opens in roughly 300 milliseconds. Editing covers text, tables, formulas, slides and shapes, with optional real-time collaboration that requires a small WebSocket backend. The project is only a few days old, lacks support for charts, pivot tables and some other features, and the author acknowledges it was largely written with AI coding assistance.

0
ProgrammingDEV Community ·

Aegis: a free personal cyber defense platform that checks links, emails, files and passwords

Aegis is a personal cyber defense platform designed to help non-technical users spot everyday threats such as fake links, deceptive emails, malicious attachments and leaked passwords. Its Smart Scan feature accepts any pasted content and automatically routes it to the appropriate analyser. The platform bundles ten tools, including URL, email and file analysers, a password lab, a breach check, a secret scanner, an encrypted vault, a website audit, a scam message checker and a domain and TLS checker. Every finding in a report comes with a suggested fix, and the project's code and live demo are publicly available. The developer also reports that the platform was hardened against its own security audit, with 186 automated tests passing.

0
ProgrammingDEV Community ·

Fail-Fast CLI Catches Silent YAML/JSON Config Drift Before Production Deploys

Configuration drift in large distributed systems often slips past basic linters, since errors like missing fields, mistyped values, or misplaced nested mappings only surface at runtime. To address this, the author built a CLI validator that parses YAML and JSON files and checks them against strict Pydantic v2 schemas inside CI/CD pipelines. The tool selects a parser based on file extension, using orjson for JSON and safe YAML loading for YAML files, and reports all validation errors in a single pass. It returns exit code 0 on success, 2 on schema violations, and 1 for other crashes. During QA testing, the script exited early because the orjson dependency was missing, a failure caused by the environment rather than the code's logic.