/blot

Blot is an interpretation of Objecthash + Multihash

Primary LanguageRustMIT LicenseMIT

Blot

Blot is a command-line interface (CLI) to compute hashes similar to tools like shasum but using a variation of Ben Laurie's objecthash combined with Multihash.

Build Status

Licensed under MIT (See LICENSE).

Features

Objecthash:

  • Tagged types: bool, dict, float, integer, list, null, raw, set, unicode.
  • Redacted values with **REDACTED**.
  • Common JSON (only when compiled with the common_json feature flag).

Multihash:

  • Hashing algorithms:
    • sha1
    • sha2
    • sha3
    • blake2
      • Maximum length (blake2b-512, blake2s-256)
      • Partial length.

Custom:

  • Redacted values with 0x77.
  • Timestamp tagged type. Note that detection is very rough and it will not guarantee a valid time.

Usage

Compact output:

$ blot -a sha2-256 '["foo", "bar"]'
122032ae896c413cfdc79eec68be9139c86ded8b279238467c216cf2bec4d5f1e4a2

Verbose output:

$ blot -a blake2b-512 --verbose '"foo"'
Codec:  0xb240 (blake2b-512)
Length: 0x40
Digest: 0x20fb5053ecefc742b73665625613de5ea09917988fac07d2977ece1c9bebb1aa0e5dfe8e3f2ae7b30ac3b97fac511a4745d71f5d4dbb211d69d06b34fb031e60

Sequences as sets instead of lists:

blot --sequence=set -a sha3-256 '["7716209dec0a5fc4b58a6d2a89c248c8ac845fc2a42ec440ec72f5f1554d3b9507689d", "bar"]'`
1620e689a806ca38fb367f300a83022aa9f1c1ad74fd6f50038f3cb5d253e7cb17c6

See also