<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mehrab Ali</title>
    <description>The latest articles on DEV Community by Mehrab Ali (@mehrab_ali).</description>
    <link>https://dev.to/mehrab_ali</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3781241%2F8a087b2b-e945-4f5b-9243-64eb676223be.jpg</url>
      <title>DEV Community: Mehrab Ali</title>
      <link>https://dev.to/mehrab_ali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mehrab_ali"/>
    <language>en</language>
    <item>
      <title>CRC32 vs SHA-256 vs XXHash: Which Checksum Should You Use?</title>
      <dc:creator>Mehrab Ali</dc:creator>
      <pubDate>Sat, 29 Aug 2026 11:30:40 +0000</pubDate>
      <link>https://dev.to/mehrab_ali/crc32-vs-sha-256-vs-xxhash-which-checksum-should-you-use-2mp2</link>
      <guid>https://dev.to/mehrab_ali/crc32-vs-sha-256-vs-xxhash-which-checksum-should-you-use-2mp2</guid>
      <description>&lt;p&gt;If you've ever needed to verify a download, find duplicate files, or prove a folder hasn't changed, you've met checksums. But which one should you actually use? The answer changes completely depending on what you're doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three contenders
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CRC32&lt;/strong&gt; — the old workhorse. Fast, tiny (32 bits), supported everywhere. Built for detecting &lt;em&gt;accidental&lt;/em&gt; corruption: bit flips during transfer, truncated downloads. It was never designed to be collision-resistant — two different files can easily share a CRC32.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;XXHash&lt;/strong&gt; — the speed demon. Non-cryptographic, extremely fast (GB/s on modern CPUs), excellent distribution. Perfect when you need speed and you control the inputs. But like CRC32, it's not collision-resistant against deliberate attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SHA-256&lt;/strong&gt; — the auditor. Cryptographic hash: finding two files with the same hash is computationally infeasible. Slower than the others (though hardware acceleration has narrowed the gap), and the right answer whenever the result needs to &lt;em&gt;prove&lt;/em&gt; something.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick decision table
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Detecting accidental transfer corruption?&lt;/strong&gt; CRC32 or XXHash — fast is fine&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finding duplicate files by content?&lt;/strong&gt; XXHash or SHA-256 — you need real collision resistance so you don't delete the wrong file&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proving file integrity for an audit, legal case, or backup verification?&lt;/strong&gt; SHA-256, always. A court or compliance team won't accept CRC32&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparing folders between two machines?&lt;/strong&gt; SHA-256 — the fingerprint has to be trustworthy across time and systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The mistake most people make
&lt;/h2&gt;

&lt;p&gt;Using CRC32 for duplicate-file detection. If you're about to &lt;em&gt;delete&lt;/em&gt; files based on matching hashes, a 1-in-4-billion collision chance is not the safety margin you want — especially across large media libraries where similar-looking files abound. For anything destructive, use SHA-256 and treat hashes as evidence, not hints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing this at folder scale
&lt;/h2&gt;

&lt;p&gt;Single files are easy (&lt;code&gt;certutil -hashfile&lt;/code&gt; on Windows, &lt;code&gt;sha256sum&lt;/code&gt; on Linux). The hard part is whole folders: thousands of files, re-verification over time, and producing a report someone else can read.&lt;/p&gt;

&lt;p&gt;That's exactly what we built &lt;a href="https://www.foldermanifest.com" rel="noopener noreferrer"&gt;FolderManifest&lt;/a&gt; for — save a folder snapshot with SHA-256 fingerprints, verify later, and get a report showing exactly what was added, removed, or changed. There's also a free browser-based &lt;a href="https://www.foldermanifest.com/tools/checksum-calculator" rel="noopener noreferrer"&gt;checksum calculator&lt;/a&gt; if you just need a quick hash without installing anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;CRC32: speed, corruption checks, compatibility&lt;/li&gt;
&lt;li&gt;XXHash: maximum speed for dedup and comparisons&lt;/li&gt;
&lt;li&gt;SHA-256: proof, audits, anything destructive or legal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pick based on the consequence of being wrong — not on benchmarks alone.&lt;/p&gt;

</description>
      <category>security</category>
      <category>programming</category>
      <category>files</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
