nix hash to-sri
could infer hash type from hash length
#10606
Labels
feature
Feature request or proposal
nix hash to-sri
could infer hash type from hash length
#10606
Is your feature request related to a problem? Please describe.
I'm always frustrated when I run a command like
nix hash to-sri
and get an error:The error message doesn't remind me particularly well what the solution is (
--type sha256
), but more importantly it's actually entirely possible for Nix to figure out what I meant here. The four documented options for--type
aremd5
,sha1
,sha256
, andsha512
, and only one of those actually works:Describe the solution you'd like
If it's unambiguous what kind of hash I've passed
nix hash to-sri
(or any other command accepting a hash), I'd like it to Just Work.Describe alternatives you've considered
I suppose I can see an argument for not reducing the overall friction of base32 hashes too much, if there is an ongoing effort to stop using them in favour of SRI hashes, but that shouldn't apply to
to-sri
– that just makes it more difficult to move away from base32 hashes.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: