diff options
author | Benjamin Barenblat <bbaren@google.com> | 2018-01-26 20:50:10 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2018-01-26 20:50:10 -0500 |
commit | 4f5f81d8df452b83dbe0f9f31c4d657200c54dfd (patch) | |
tree | 65ae44835ea86929af3836edd393078123a47201 /tests | |
parent | 4e56c79b907da4a4654e5278bdcf94b08480a426 (diff) |
Data.Digest.Sha2: Accept lazy ByteStrings
Switch SHA-2 API to use lazy ByteStrings rather than strict. Lazy
ByteStrings make the hash function compatible with streaming I/O
patterns; users no longer need to preload all the data they wish to hash
into RAM.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Data/Digest/Sha2Tests.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/Data/Digest/Sha2Tests.hs b/tests/Data/Digest/Sha2Tests.hs index cc12299..248d23c 100644 --- a/tests/Data/Digest/Sha2Tests.hs +++ b/tests/Data/Digest/Sha2Tests.hs @@ -6,6 +6,7 @@ module Data.Digest.Sha2Tests import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as ByteString +import qualified Data.ByteString.Lazy as ByteString.Lazy import System.IO (hClose, hGetContents, hSetBinaryMode) import System.Process (CreateProcess(std_in, std_out), StdStream(CreatePipe), @@ -532,10 +533,10 @@ testAgainstOpenssl f flag = -- Convenience functions. -sha224sum = show . sha224 +sha224sum = show . sha224 . ByteString.Lazy.fromStrict -sha256sum = show . sha256 +sha256sum = show . sha256 . ByteString.Lazy.fromStrict -sha384sum = show . sha384 +sha384sum = show . sha384 . ByteString.Lazy.fromStrict -sha512sum = show . sha512 +sha512sum = show . sha512 . ByteString.Lazy.fromStrict |