aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/src/command-ref/nix-hash.md
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-24 12:56:19 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-24 12:56:19 +0200
commit758c9ee1bb0e9d4bea420420af93e0128fabf188 (patch)
tree006550d0c3eab47099c17602cb6a03b476195417 /doc/manual/src/command-ref/nix-hash.md
parent8d0b311a1ccd0aef49c6f272aad4ecb5105b285a (diff)
Clean up the manpages
Diffstat (limited to 'doc/manual/src/command-ref/nix-hash.md')
-rw-r--r--doc/manual/src/command-ref/nix-hash.md50
1 files changed, 14 insertions, 36 deletions
diff --git a/doc/manual/src/command-ref/nix-hash.md b/doc/manual/src/command-ref/nix-hash.md
index 3b8bbf740..38c9e0f67 100644
--- a/doc/manual/src/command-ref/nix-hash.md
+++ b/doc/manual/src/command-ref/nix-hash.md
@@ -1,38 +1,16 @@
-nix-hash
+Title: nix-hash
-1
+# Name
-Nix
+`nix-hash` - compute the cryptographic hash of a path
-nix-hash
+# Synopsis
-compute the cryptographic hash of a path
+`nix-hash` [`--flat`] [`--base32`] [`--truncate`] [`--type` *hashAlgo*] *path…*
-nix-hash
+`nix-hash` `--to-base16` *hash…*
-\--flat
-
-\--base32
-
-\--truncate
-
-\--type
-
-hashAlgo
-
-path
-
-nix-hash
-
-\--to-base16
-
-hash
-
-nix-hash
-
-\--to-base32
-
-hash
+`nix-hash` `--to-base32` *hash…*
# Description
@@ -92,22 +70,22 @@ Computing hashes:
$ mkdir test
$ echo "hello" > test/world
-
+
$ nix-hash test/ (MD5 hash; default)
8179d3caeff1869b5ba1744e5a245c04
-
+
$ nix-store --dump test/ | md5sum (for comparison)
8179d3caeff1869b5ba1744e5a245c04 -
-
+
$ nix-hash --type sha1 test/
e4fd8ba5f7bbeaea5ace89fe10255536cd60dab6
-
+
$ nix-hash --type sha1 --base32 test/
nvd61k9nalji1zl9rrdfmsmvyyjqpzg4
-
+
$ nix-hash --type sha256 --flat test/
error: reading file `test/': Is a directory
-
+
$ nix-hash --type sha256 --flat test/world
5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
@@ -115,6 +93,6 @@ Converting between hexadecimal and base-32:
$ nix-hash --type sha1 --to-base32 e4fd8ba5f7bbeaea5ace89fe10255536cd60dab6
nvd61k9nalji1zl9rrdfmsmvyyjqpzg4
-
+
$ nix-hash --type sha1 --to-base16 nvd61k9nalji1zl9rrdfmsmvyyjqpzg4
e4fd8ba5f7bbeaea5ace89fe10255536cd60dab6