Giter Site home page Giter Site logo

chksum's Introduction

chksum

Build Release crates.io LICENSE

For people who wants to make checksum of whole directory but doesn't like piping.

$ find /path -type f -exec md5sum \{\} + | sort -k1 | md5sum

Running by a CLI

Installation

$ cargo install chksum-cli

Usage

$ chksum-cli [options] [--] <path>...

Like

$ chksum-cli LICENSE
3b7c11a62208f03df96f7cfe215b1e28 LICENSE
$ md5sum LICENSE
3b7c11a62208f03df96f7cfe215b1e28  LICENSE
$ chksum-cli --hash SHA1 docs/ extra/
bc6f0730053530230d6a205309acb606d51130b7 docs/
eb6d3cb291b58ebed93893848b3549264f01290b extra/
$ find docs/ -type f | sort | xargs cat | sha1sum
bc6f0730053530230d6a205309acb606d51130b7  -

See chksum-cli/README.md for more.

Using as a library

See chksum/README.md for more.

Synchronous

Enable sync feature during installation.

$ cargo install chksum[sync]

Code example.

use chksum::arch::x1::Arch;
use chksum::hash::md5;
use chksum::prelude::*;

let mut hash = md5::Hash::<Arch>::new();
let digest = "path/to/file".chksum(&mut hash)?;
println!("digest {:x}", digest);

Asynchronous

Enable async feature during installation.

$ cargo install chksum[async]

Code example.

use chksum::arch::x1::Arch;
use chksum::hash::md5;
use chksum::prelude::*;

let mut hash = md5::Hash::<Arch>::new();
let digest = "path/to/file".chksum(&mut hash).await?;
println!("digest {:x}", digest);

Hash algorithms

Currently there are implemented two hash algorithms:

chksum's People

Contributors

ventaquil avatar

Watchers

James Cloos avatar

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.