From 0ed87caa3481cbb6f8c2e809e5ec7df6f6245406 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 23 Mar 2018 18:34:42 -0400 Subject: Data.Digest: Reify hash algorithms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminate the functional interface for hashing. Hashing now occurs exclusively through the `hash` function, which accepts a `Data.Digest.Algorithm`. This makes btls somewhat less extensible, but it’s the most elegant way to support HMACs. --- tests/Data/Digest/Sha1Tests.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/Data/Digest/Sha1Tests.hs') diff --git a/tests/Data/Digest/Sha1Tests.hs b/tests/Data/Digest/Sha1Tests.hs index cd1f1c6..63c774d 100644 --- a/tests/Data/Digest/Sha1Tests.hs +++ b/tests/Data/Digest/Sha1Tests.hs @@ -11,12 +11,12 @@ import Test.Tasty.SmallCheck (testProperty) import Data.Digest.HashTests (tableTestCase, testAgainstCoreutils, testAgainstOpenssl) -import Data.Digest.Sha1 +import Data.Digest (hash, sha1) tests :: TestTree tests = testGroup - "Data.Digest.Sha1" + "SHA-1" [ testNistExamples , testGoExamples , testCoreutilsConformance @@ -107,4 +107,4 @@ testOpensslConformance = -- Convenience function. -sha1sum = show . sha1 . ByteString.Lazy.fromStrict +sha1sum = show . hash sha1 . ByteString.Lazy.fromStrict -- cgit v1.2.3