Skip to content

Commit

Permalink
add examples to the b3sum readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oconnor663 committed Feb 19, 2020
1 parent fdd329b commit 9f6104c
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions b3sum/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# b3sum

A command line utility for calculating
[BLAKE3](https://github.com/BLAKE3-team/BLAKE3) hashes, similar to
Coreutils tools like `b2sum` or `md5sum`.

```
b3sum 0.2.1
Expand All @@ -23,7 +27,27 @@ ARGS:
<file>...
```

# Building
# Example

Hash the file `foo.txt`:

```bash
b3sum foo.txt
```

Time hashing a gigabyte of data, to see how fast it is:

```bash
# Create a 1 GB file.
head -c 1000000000 /dev/zero > /tmp/bigfile
# Hash it with SHA-256.
time openssl sha256 /tmp/bigfile
# Hash it with BLAKE3.
time b3sum /tmp/bigfile
```


# Installation

The standard way to install `b3sum` is:

Expand All @@ -39,6 +63,8 @@ If you want to install directly from this directory, you can run `cargo
install --path .`. Or you can just build with `cargo build --release`,
which puts the binary at `./target/release/b3sum`.

AVX-512 support (via C FFI, with dynamic CPU feature detection) and
multi-threading (via Rayon) are enabled by default. Note that the
underlying `blake3` crate does not enable those by default.
By default, `b3sum` enables the assembly implementations, AVX-512
support, and multi-threading features of the underlying
[`blake3`](https://crates.io/crates/blake3) crate. To avoid this (for
example, if your C compiler does not support AVX-512), you can use
Cargo's `--no-default-features` flag.

0 comments on commit 9f6104c

Please sign in to comment.