Markus1189
Markus1189

Reputation: 2869

Different sha256 between nix-hash and nix-prefetch-url

When I want to precompute the sha256 of a downloaded file foo.txt, the output of nix-hash on the manually downloaded file is different from the one that is printed by nix-prefetch-url.

How can I compute the same hash with nix-hash?

Upvotes: 0

Views: 1427

Answers (1)

Markus1189
Markus1189

Reputation: 2869

The standard format of nix-hash is different from the one that nix-prefetch-url uses.

To get the same output from the manually downloaded file as nix-prefetch-url would give, run nix-hash like this:

nix-hash --type sha256 --flat --base32 <file>

Upvotes: 0

Related Questions