Giter Club home page Giter Club logo

checksumthing's Introduction

checksumthing

The ultimate checksum script! Checksumthing helps you create different kinds of checksum sidecar files.

What is checksumthing?

checksumthing helps you transform your checksum files in the format that you want. Different pieces of software used to produce checksums create sidecar files (typically files ending in .md5 or .sha1) with very different formatting, which creates headaches for archivists—we love standards and loathe disorder. checksumthing is a Python script that can solve this problem by allowing users to transform the data inside sidecar files into a standardized format most convenient for them. For example, you can:

  • Append text before or after the checksum value (like the path to the file or the filename)
  • Change the checksum text to all caps or all lowercase
  • Search for checksum files and transform files through a nested directory structure

checksumthing currently supports MD5, SHA1, and SHA256 checksums. Right now the script only supports plaintext sidecar files. In the future, we hope to support CSV and other types of files.

Software Requirements and Compatibility

How to Run or Install

You can run checksumthing straight out of the box by cloning the repostory, opening up the command line (Terminal in Mac OS X), navigating to the "checksumthing" directory, and running python checksumthing.py along with any arguments that you need.

There is also an install process that allows you run checksumthing as a regular command. To install, clone the repository and then navigate to your checksumthing directory. Run python setup.py install. To test your install run checksumthing -h. If you see the checksumthing help menu the install was successful. Time to put down your cocktail!

For more information on running checksumthing please see the online documentation.

Running checksumthing with Sample Data

Our repository includes some sample image files and checksum files to work with located in the (suprise, surprise) Sample_Files folder. These sample commands are designed to be run after you install checksumthing:

checksumthing -i Sample_Files/ -ie .md5 -t md5 -c upper -r -pre '#######' -post '*{relativepath}'

The above command will attempt to overwrite the data in the existing .md5 files with with "#######" appearing before the checksum and then the relative path to the associated file appearing after the checksum. It will also make the checksum all upper case. The command will work recursively through all the sample folders. It will prompt the user before overwriting any files.

checksumthing -i Sample_Files/ -ie .md5 -t md5 -c upper -r -pre '#######' -post '*{relativepath}' -o Sample_Files/checksum_manifest.txt

The above command will create a manifest file called "checksum_manifest.txt" with a list of checksums for all the sample files. For each file, it will print "#######" before the checksum (the checksum will be in upper case) and then print the relative path to the file. If a manifest already exists, it will prompt the user to make sure they would like to overwrite the existing manifest.

Currently, the script cannot make csv files through a dedicated method. However, we can make csv files by hacking the current manifest creation method. Let's say you want a csv file where the first column is the filename, the second column is the relative path to the file, and the third column is the hash with lowercase letters. The follow string would create this for you:

checksumthing -i Sample_Files/ -ie .md5 -t md5 -c lower -r -pre '{filename},{relativepath},' -ns -o Sample_Files/checksum_manifest.csv

Notice, the use of the -ns flag, which removes spaces between the pre, hash, and post portions of the text. Without this flag, there would be a space added to the hash, which could cause problems.

This script can also be used to mimick the output of other checksum creation tools. The following string mimicks the output of the md5deep tool in recursive mode:

checksumthing -i Sample_Files/ -ie .md5 -t md5 -c lower -r -post ' {fullpath}' -o Sample_Files/md5deepstyle.txt

If for some reason you are not able to run any of the commands here, you can still run the script by navigating to the "checksumthing" directory, and run python checksumthing.py along with any arguments that you need.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.