I was trying out this example from the cryptohash documentation:
import qualified Crypto.Hash.SHA1 as SHA1
main = putStrLn $ show $ SHA1.hash (Data.ByteString.pack [1..256])
and I was puzzled because it seemed to be using a zero-length bytestring. That turns out to be the case, because Data.ByteString.pack takes a [Word8], and:
[1..256] :: [Word8]
is the same as:
[1..0] :: [Word8]
which is the same as:
[] :: [Word8]
I assume the intent was to hash 256 bytes, so I've submitted a patch to hash [0..255] instead of [1..256].
I was trying out this example from the cryptohash documentation:
and I was puzzled because it seemed to be using a zero-length bytestring. That turns out to be the case, because Data.ByteString.pack takes a [Word8], and:
is the same as:
which is the same as:
I assume the intent was to hash 256 bytes, so I've submitted a patch to hash [0..255] instead of [1..256].