How to Work With File Checksums

Checksums are alphanumeric character sequences produced by running files through an algorithm. They are especially helpful in verifying file integrity since small changes in files can result in significant checksum differences.

One example of a way checksums are helpful can be to ensure your backup files are not corrupted. By doing so, you will gain an additional layer of security– if anything goes wrong with your site, you can restore it from files that are known to be undamaged.

Generating a Checksum

You can generate a checksum for any file by accessing the command line on your server. Use SSH to connect to your account (See “Connect to My Server With SSH”), then generate the checksum as follows:

md5sum file > checksum.txt

The above command will generate a checksum file called “checksum.txt” using the MD5 algorithm. Another commonly used checksum algorithm is SHA, a general term for a group of similar algorithms such as SHA-256 and SHA-512. 

SHA algorithms are denoted separately due to the varying length of the hash value’s bit length. For example, SHA-256 will be SHA with a 256-bit length.

How to Verify Checksums

Generating the checksum is only half of the job done. Once the file moves for any reason, it should be verified. To verify your file checksum, connect to your server again via SSH and type the following instruction;

md5sum -c checksum.txt

The result of this check will either be an “OK” or “FAILED.” Failed checksums mean there is a problem with the file integrity. While the difference may be minor, it can also be challenging to tell the exact problem.

If your file fails a checksum verification, you should discard the file and transfer a fresh copy. Then, you must rerun the checksum verification.

Was this helpful?

What’s your goal today?

1. Find the right Web hosting solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

Rado
Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.