We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
+ 1
- 1
printHashBytes32
1 parent 9bbe54a commit ecf4d99Copy full SHA for ecf4d99
hnix-store-core/src/System/Nix/Internal/Hash.hs
@@ -125,7 +125,10 @@ newtype Digest (a :: HashAlgorithm) = Digest
125
printHashBytes32 :: BS.ByteString -> T.Text
126
printHashBytes32 c = T.pack $ concatMap char32 [nChar - 1, nChar - 2 .. 0]
127
where
128
- -- The base32 encoding is 8/5's as long as the base256 digest
+ -- The base32 encoding is 8/5's as long as the base256 digest. This `+ 1`
129
+ -- `- 1` business is a bit odd, but has always been used in C++ since the
130
+ -- base32 truncation was added in was first added in
131
+ -- d58a11e019813902b6c4547ca61a127938b2cc20.
132
nChar = fromIntegral $ ((BS.length c * 8 - 1) `div` 5) + 1
133
134
char32 :: Integer -> [Char]
0 commit comments