.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-hash-convert" "1" "" .RS .PP \fBWarning\fR .br This program is \fB\fBexperimental\fR\fR and its interface is subject to change. .RE .SH Name .LP \fCnix hash convert\fR - convert between hash formats .SH Synopsis .LP \fCnix hash convert\fR [\fIoption\fR\[u2026]] \fIhashes\fR\[u2026] .SH Examples .IP "\(bu" 3 Convert a hash to \fCnix32\fR (a base-32 encoding with a Nix-specific character set). .LP .EX $ nix hash convert --hash-algo sha1 --to nix32 800d59cfcd3c05e900cb4e214be48f6b886a08df vw46m23bizj4n8afrc0fj19wrp7mj3c0 .EE .IP "\(bu" 3 Convert a hash to \fBthe \fCsri\fR format\fR that includes an algorithm specification: .LP .EX # nix hash convert --hash-algo sha1 800d59cfcd3c05e900cb4e214be48f6b886a08df sha1-gA1Zz808BekAy04hS+SPa4hqCN8= .EE .IP or with an explicit \fC--to\fR format: .LP .EX # nix hash convert --hash-algo sha1 --to sri 800d59cfcd3c05e900cb4e214be48f6b886a08df sha1-gA1Zz808BekAy04hS+SPa4hqCN8= .EE .IP "\(bu" 3 Assert the input format of the hash: .LP .EX # nix hash convert --hash-algo sha256 --from nix32 ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0= error: input hash 'ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=' does not have the expected format '--from nix32' # nix hash convert --hash-algo sha256 --from nix32 1b8m03r63zqhnjf7l5wnldhh7c134ap5vpj0850ymkq1iyzicy5s sha256-ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0= .EE .SH Description .LP \fCnix hash convert\fR converts hashes from one encoding to another. .SH Options .IP "\(bu" 3 \fB\fC--from\fR\fR \fIhash-format\fR .IP Hash format (\fCbase16\fR, \fCnix32\fR, \fCbase64\fR, \fCsri\fR). .IP "\(bu" 3 \fB\fC--hash-algo\fR\fR \fIhash-algo\fR .IP Hash algorithm (\fCmd5\fR, \fCsha1\fR, \fCsha256\fR, or \fCsha512\fR). Can be omitted for SRI hashes. .IP "\(bu" 3 \fB\fC--to\fR\fR \fIhash-format\fR .IP Hash format (\fCbase16\fR, \fCnix32\fR, \fCbase64\fR, \fCsri\fR). Default: \fCsri\fR. .SS Logging-related options .IP "\(bu" 3 \fB\fC--debug\fR\fR .IP Set the logging verbosity level to \(oqdebug\(cq. .IP "\(bu" 3 \fB\fC--log-format\fR\fR \fIformat\fR .IP Set the format of log output; one of \fCraw\fR, \fCinternal-json\fR, \fCbar\fR or \fCbar-with-logs\fR. .IP "\(bu" 3 \fB\fC--print-build-logs\fR\fR / \fC-L\fR .IP Print full build logs on standard error. .IP "\(bu" 3 \fB\fC--quiet\fR\fR .IP Decrease the logging verbosity level. .IP "\(bu" 3 \fB\fC--verbose\fR\fR / \fC-v\fR .IP Increase the logging verbosity level. .SS Miscellaneous global options .IP "\(bu" 3 \fB\fC--help\fR\fR .IP Show usage information. .IP "\(bu" 3 \fB\fC--offline\fR\fR .IP Disable substituters and consider all previously downloaded files up-to-date. .IP "\(bu" 3 \fB\fC--option\fR\fR \fIname\fR \fIvalue\fR .IP Set the Nix configuration setting \fIname\fR to \fIvalue\fR (overriding \fCnix.conf\fR). .IP "\(bu" 3 \fB\fC--refresh\fR\fR .IP Consider all previously downloaded files out-of-date. .IP "\(bu" 3 \fB\fC--version\fR\fR .IP Show version information. .RS .LP \fBNote\fR .PP See \fB\fCman nix.conf\fR\fR for overriding configuration settings with command line flags. .RE