guix hash command computes the hash of a file. It is
primarily a convenience tool for anyone contributing to the distribution: it
computes the cryptographic hash of a file, which can be used in the
definition of a package (see Описание пакетов).
guix hash option file
When file is
- (a hyphen),
guix hash computes the
hash of data read from standard input.
guix hash has the
Compute a hash using the specified algorithm,
algorithm must the name of a cryptographic hash algorithm supported by
Libgcrypt via Guile-Gcrypt—e.g.,
(see Hash Functions in Guile-Gcrypt Reference Manual).
Write the hash in the format specified by fmt.
hexadecimal can be used as well).
If the --format option is not specified,
guix hash will
output the hash in
nix-base32. This representation is used in the
definitions of packages.
Compute the hash on file recursively.
In this case, the hash is computed on an archive containing file, including its children if it is a directory. Some of the metadata of file is part of the archive; for instance, when file is a regular file, the hash is different depending on whether file is executable or not. Metadata such as time stamps has no impact on the hash (see Вызов guix archive).
When combined with --recursive, exclude version control system directories (.bzr, .git, .hg, etc.).
As an example, here is how you would compute the hash of a Git checkout,
which is useful when using the
git-fetch method (see Интерфейс origin):
$ git clone http://example.org/foo.git $ cd foo $ guix hash -rx .