-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sha256 - Nothing makes sense #806
Comments
Perhaps we should standardize on the base32 hash scheme across all of our tools? I think they're the same hash but one is base16 and the other is base32. |
Thank you. I thought I was losing my mind. |
So let's close this issue? |
But then no one will know to standardize the hash.
|
You typically don't need to know. There are two formats widely used, and nix allows both interchangeably. |
This caused me a good bit of headache, making it very difficult to visually compare. I'd +1 standardizing on base32. |
It should obviously output the code to recompute it on the shell again. These kind of error messages can only be created by someone who is just as insane as the message itself. I don't care who did it; it's just stupid beyond belief. I don't care how much useful code one writes, if someone also creates this kind of mess. At that point such a person becomes a liability and in a company you would let go of such a person. In open-source it doesn't work like that, unfortunately. All I would like to see is that people think a bit more before they submit code to a repository which is used by more people. |
@0xABAB please stay constructive. We're already putting a lot of effort (since NixCon last year and a call to arms to improve usability) into making a historically user-unfriendly tool into something more user-focused, and having someone drive-by sniping at random examples of the historical user-unfriendliness helps nobody. |
This bit me today: nix-prefetch-git passes the |
@edolstra is there any downside to standardizing on base32, other than it being slightly unconventional? I've seen several examples of it being confusing to people even outside of this ticket. |
cc @svanderburg for npm2nix mention. |
Or all our tools might accept both on input, just as |
Personally I would not mind having a small utility that can easily convert between the two, just for sanity checking. |
@armijnhemel: we've always had that. Example:
|
Not always! I remember that not being there back in the day ;-) |
Feel free to ignore my ignorance, but as i started experimenting with Nix this was one of the things that stood out to me. This field is misleading as it doesn't contain a sha256 hash, it contains a base32-encoded sha256 hash. Perhaps, just Is base32 being used to reduce the string length? Because hashes are already [0-9][a-f], thus base32/48/64 encoding doesn't improve readability/compatibility. |
Well, a SHA-256 hash is a sequence of bytes, not a sequence of a hexadecimal digits. A base32 encoding of it is no less real than a base16 encoding. Yes, base32 was primarily used to reduce string lengths. Note that Nix 2.2 adds SRI hashes, which have the advantage of being standard and even shorter (because they use base64). For example, import <nix/fetchurl.nix> {
url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz;
hash = "sha256-XSLa0FjVyADWWhFfkZ2iKTjFDda6mMXjoYMXLRSYQKQ=";
} I'll close this issue because the solution to the confusion is to use SRI hashes everywhere in the future. |
Nothing makes sense.
The text was updated successfully, but these errors were encountered: