How to checksum

By  on  

Many of us see the term checksum and checksum outputs frequently but don't really take the time to run them -- oftentimes we simply trust the file we've downloaded is in working order and from the original source.  This past weekend when I was attempting to recover my Bitcoin Cash, however, I wasn't willing to chance it -- I wanted to ensure the app/file hadn't been compromised in any way.

For those who don't know what a checksum is, I think this definition from Lifewire is helpful:

A checksum is the outcome of running an algorithm, called a cryptographic hash function, on a piece of data, usually a single file. Comparing the checksum that you generate from your version of the file, with the one provided by the source of the file, helps ensure that your copy of the file is genuine and error free.

Armed with the file I wanted, and the verified checksum provided by the author, I ran a checksum on the file in question:

shasum 1 logo.png

# shasum: 1:
# e78c5ca49b926a15b3d4e5107f3b17b2cc6fd54b  logo.png

shasum is Mac's command line command for checking checkums.  The first argument represents which sha hash value you want to use (sha-1, sha-256, etc.) . The last argument is the file to check.

When it comes to financial and critical apps and files, it's probably worth your time to run a quick checksum to ensure what you've downloaded is what you really want!

Recent Features

  • By
    5 HTML5 APIs You Didn’t Know Existed

    When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It."  Can you blame us though?  We watched the fundamental APIs stagnate for so long that a basic feature...

  • By
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

Incredible Demos

  • By
    HTML5 download Attribute

    I tend to get caught up on the JavaScript side of the HTML5 revolution, and can you blame me?  HTML5 gives us awesome "big" stuff like WebSockets, Web Workers, History, Storage and little helpers like the Element classList collection.  There are, however, smaller features in...

  • By
    CSS Ellipsis Beginning of String

    I was incredibly happy when CSS text-overflow: ellipsis (married with fixed width and overflow: hidden was introduced to the CSS spec and browsers; the feature allowed us to stop trying to marry JavaScript width calculation with string width calculation and truncation.  CSS ellipsis was also very friendly to...

Discussion

  1. Thanks for that. I hadn’t had to do it on the Mac side yet but on Windows the equivalent built-in utility is called CertUtil.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!