Expand description

Tool for making/verifying hashes.

Library doc

The library it’s self is used in this project as well due it contains all needed functions.

Data flow

Hash verification

Options
|> create_hashes()
|> load_hashes()
|> compare_hashes()
|> write_hash_comparison_results()

Hash creation

Options
|> create_hashes()
|> write_hashes()

Executable manpage

Exit values and possible errors:

1   - option parsing error
2   - hash lengths differ between selected and saved
3   - failed to parse hashes file
N+3 - N files didn't match

SYNOPSIS

QuickDash [OPTIONS] [DIRECTORY]

DESCRIPTION

This is a utility for making/checking hashes with blazing-fast speed. All most well-known hash functions are supported, like MD5, SHA1, SHA2 etc. It’s licensed under Apache-2.0 License.

OPTIONS

-a –algorithm <algorithm>

Quite simple, select the hash you want. Case-insensitive.

Supported algorithms: SHA{1,2-,3-{224,256,384,512}, CRC32, MD5, BLAKE{2B,2S,3}, XXH3, XXHASH64

-c –create

A very simple command. What it does, it creates hashes.
If user didn't specified the name it will use, the name of folder with `.hash` extension.

And will also fail if the output file exists already and the command `--force` is not presented.

Only with `--verify`. Overrides `--verify`.

-v –verify

Verify directory hashes. Used by default.

Only with `--create`. Overrides `--create`.

-d –depth <depth>

Set max recursion depth to `depth`. Default: 0.

Only with `--recursive`. Overrides `--recursive`.

-r –recursive

Set max recursion depth to infinity. By default it doesn't recurse.

Only with `--depth`. Overrides `--depth`.

–follow-symlinks

Recurse down symlinks. Default.

–no-follow-symlinks

Don't recurse down symlinks.

-i –ignore <filename[,filename2][,filename3][,filenameN]…>…

Add filename(s) to ignored files list. Default: not used.

The program marks the files that will be ignored. The specified ignored files will not come to the output file.

Can be used multiple times.

–force

Rewrite the output file in `--create` mode.

-j –jobs [jobs]

Amount of threads used for hashing. Default: # of CPU threads

One thread can hash one file at a time, potentially speeding up hashing
up to `jobs` times.

No/empty value: # of CPU threads. value = 0: maximum, of u8 (255)
                                   

[DIRECTORY]

Directory to create/verify hash for. By default is current workdir.

EXAMPLES

quickdash [-v] [-f infile]

Verify the current directory using the saved hashes.

`-v` is not necessary as it's the default.

*infile* defaults to "`DIRECTORY`.hash"

Example output:
  File added: "file_that_hasnt_been_before"
  File removed: "file_that_was_originally_here_before_but_not_now"
  File ignored: "file_specified_with_ignore_now_or_during_creation"

  File "file_that_did_not_change" matches
  File "changed_file" doesn't match
    Was: foo
    Is : bar

examples -c [-f outfile] [--force]

Create hashes of the current directory tree for later verification.

*outfile* defaults to "`DIRECTORY`.hash".

Use `--force` to override *outfile*.

*outfile* contents:
  F013BF0B163785CBB3BE52DE981E069E2B64E1CAC863815AC7BEED63E1734BAE  Cargo.toml
  E84E380AEBDA3D98E96267201D61784C3D6FFB128C4D669E6C1D994C7D7BF32B  Cross.toml

Modules

Main functions doing actual work.

Module containing various utility functions

Structs

Enums

A hashing algorithm.

Enum representing each way the appication can fail.

Functions

Hash the specified file using the specified hashing algorithm.

Hash the specified byte stream using the specified hashing algorithm.

Create a hash string out of its raw bytes.