Nix Hash: Difference between revisions
imported>Milahu m fix link: markdown -> wiki |
imported>R-k-b `nix to-sri` doesn't exist anymore, now it's under `nix hash to-sri`, see https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-hash.html |
||
Line 51: | Line 51: | ||
|- | |- | ||
| <code>nix-hash --flat --type $HASHTYPE</code> | | <code>nix-hash --flat --type $HASHTYPE</code> | ||
| <code>nix hash | | <code>nix hash file --base16 --type $HASHTYPE</code>, see [[Nix_command/hash-file]] | ||
| Hash a file by using a “flat” hash which directly hashes a file and behaves like the <code>{md5,sha1,sha256,sha512}sum</code> utilities. | | Hash a file by using a “flat” hash which directly hashes a file and behaves like the <code>{md5,sha1,sha256,sha512}sum</code> utilities. | ||
|- | |- | ||
| <code>nix-hash --flat --base32 --type $HASHTYPE</code> | | <code>nix-hash --flat --base32 --type $HASHTYPE</code> | ||
| <code> nix hash | | <code> nix hash file --base32 --type $HASHTYPE</code> | ||
| Like above, but with the more used base32 output. | | Like above, but with the more used base32 output. | ||
|- | |- | ||
| <code>nix-hash --type $HASHTYPE</code> | | <code>nix-hash --type $HASHTYPE</code> | ||
| <code> nix hash | | <code> nix hash path --base16 --type $HASHTYPE</code>, see [[Nix_command/hash-path]] | ||
| Compute the hash of a given path's dump in the NAR format. | | Compute the hash of a given path's dump in the NAR format. | ||
|- | |- | ||
| <code>nix-hash --base32 --type $HASHTYPE</code> | | <code>nix-hash --base32 --type $HASHTYPE</code> | ||
| <code> nix hash | | <code> nix hash path --base32 --type $HASHTYPE</code> | ||
| Like above, but with the more common base32 representation. | | Like above, but with the more common base32 representation. | ||
|- | |- | ||
Line 75: | Line 75: | ||
|- | |- | ||
| (not supported) | | (not supported) | ||
| <code>nix to-sri --type $HASHTYPE</code>, see [[Nix_command/to-sri]] | | <code>nix hash to-sri --type $HASHTYPE</code>, see [[Nix_command/to-sri]] | ||
| Convert a hash of <code>$HASHTYPE</code> to its SRI representation. | | Convert a hash of <code>$HASHTYPE</code> to its SRI representation. | ||
|- | |- | ||
| (not supported) | | (not supported) | ||
| <code>nix to-base64 --type $HASHTYPE</code>, see [[Nix_command/to-base64]] | | <code>nix hash to-base64 --type $HASHTYPE</code>, see [[Nix_command/to-base64]] | ||
| Convert a hash of <code>$HASHTYPE</code> to its base64 representation which is the SRI representation without the hash type indication. | | Convert a hash of <code>$HASHTYPE</code> to its base64 representation which is the SRI representation without the hash type indication. | ||
|} | |} |