项目作者: nwtgck

项目描述 :
CLI for streaming message digest calculator - Insert into pipe, get the digest in tty
高级语言: Go
项目地址: git://github.com/nwtgck/digestream.git
创建时间: 2019-01-28T11:45:54Z
项目社区:https://github.com/nwtgck/digestream

开源协议:MIT License

下载


digestream

CircleCI

Streaming message digest calculator: Insert digest calculation inside pipe

Installation

Get executable binaries from GitHub Releases

Usage

Here is an example to use digestream. The command below allows you to download ubuntu.iso and calculate message digest at the same time.

  1. curl http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso | digestream > ubuntu.iso

Then you will have a SHA-256 digest as follows in tty.

  1. 5748706937539418ee5707bd538c4f5eabae485d17aa49fb13ce2c9b70532433

Note that the message digest, 5748706937...433 is output to tty not to stdout.
The command above is the same as curl ... > ubuntu.iso except for digest calculation.

Motivation

One of the motivations of digestream is for Piping Server, which is a server to allow users to transfer data via HTTP.
You can get more information in https://github.com/nwtgck/piping-server.

By using digestream, users get more confident to send data correctly.

  1. # Sender
  2. seq 1000 | digestream | curl -T - https://piping.glitch.me/myseq
  1. # Receiver
  2. curl https://piping.glitch.me/myseq | digestream > myseq.txt

Algorithms

Here is examples to use md5, sham256 and sha512. In current implementation, sham256 is the default algorithm. But the default algorithm may be changed in the future by technology improvement.

  1. echo "hello, world" | digestream md5
  1. echo "hello, world" | digestream sha256
  1. echo "hello, world" | digestream sha512

Available algorithms

You can get all algorithms by digestream -h.

  1. Dige(st + St)ream
  2. Usage:
  3. digestream [flags]
  4. digestream [command]
  5. Available Commands:
  6. help Help about any command
  7. md5 MD5
  8. sha1 SHA-1
  9. sha256 SHA-256
  10. sha512 SHA-512
  11. Flags:
  12. -h, --help help for digestream
  13. Use "digestream [command] --help" for more information about a command.