sum

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2025 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sum :heavy_check_mark:

Go version Go code report card

sum is a minimal and concurrent CLI file hashing tool.

Features

  • Simple.
  • Concurrent file processing - each file is processed in its own goroutine (thread).
  • Ability to calculate union (composite) checksum.

Flags

-m - specify hash function.

Currently supported:

sha256 default
sha512 -
sha1 -
blake2b -
blake3 modern & fast
xxh3 non-cryptographic & very fast
md5 -

-u - calculate union hash (sum of multiple files combined).

Examples

sum data.txt
# aa3ec16e6acc809d8b2818662276256abfd2f1b441cb51574933f3d4bd115d11 data.txt

sum -m blake3 data.txt
# c7a4b65f79934d742ea07a9e85b3bbb1ab9ad9f42033d8a0698495d0f564c804 data.txt

sum -m md5 data.txt file2.png bin.exe
# 764569e58f53ea8b6404f6fa7fc0247f data.txt
# 79695d7d0054d14d68b513ed997f7946 file2.png
# 65e3dd724be2affbda44084e213ea63a bin.exe

sum -m xxh3 -u data.txt file2.png bin.exe
# cef94edd97ad53f0 (3 files)

Installation

The following install options are available:

Prebuilt binaries (releases)

Prebuilt binaries are available for Windows, Linux, and macOS (both x86 and ARM): download the latest release from the releases page for the desired OS.

via Go

If you have Go installed, the simplest way to get sum is to run:

go install github.com/70sh1/sum@latest

Scoop

sum is available as a part of 70sh1's scoop bucket. To install, you first need to add the bucket:

scoop bucket add jug https://github.com/70sh1/jug

After that, run:

scoop install sum

Alternatively, if you don't want to add the bucket, you can run this:

scoop install https://raw.githubusercontent.com/70sh1/jug/refs/heads/master/bucket/sum.json

[!IMPORTANT] If you are on Linux and using this method, make sure that go bin path is added to your PATH environment variable: e.g. export PATH=$PATH:$HOME/go/bin

Acknowledgements

zeebo/blake3 - blake3 implementation.

zeebo/xxh3 - xxh3 implementation.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址