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
    Designing for Simplicity

    Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...

  • By
    Chris Coyier’s Favorite CodePen Demos

    David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...

Incredible Demos

  • By
    iPhone Click Effect Using MooTools or jQuery

    One thing I love about love about Safari on the iPhone is that Safari provides a darkened background effect when you click a link. It's the most subtle of details but just enforces than an action is taking place. So why not implement that...

  • By
    New MooTools Plugin:  ElementFilter

    My new MooTools plugin, ElementFilter, provides a great way for you to allow users to search through the text of any mix of elements. Simply provide a text input box and ElementFilter does the rest of the work. The XHTML I've used a list for this example...

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!