{-# LANGUAGE DataKinds #-}
module Data.Digest.Blake2 where
import Crypto.Hash (Blake2b, Digest, hash)
import Data.ByteArray (convert)
import Data.ByteString (ByteString)
blake2_64 :: ByteString -> ByteString
{-# INLINE blake2_64 #-}
blake2_64 :: ByteString -> ByteString
blake2_64 = Digest (Blake2b 64) -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert (Digest (Blake2b 64) -> ByteString)
-> (ByteString -> Digest (Blake2b 64)) -> ByteString -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ByteString -> Digest (Blake2b 64)
forall ba a.
(ByteArrayAccess ba, HashAlgorithm a) =>
ba -> Digest a
hash :: ByteString -> Digest (Blake2b 64))
blake2_128 :: ByteString -> ByteString
{-# INLINE blake2_128 #-}
blake2_128 :: ByteString -> ByteString
blake2_128 = Digest (Blake2b 128) -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert (Digest (Blake2b 128) -> ByteString)
-> (ByteString -> Digest (Blake2b 128)) -> ByteString -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ByteString -> Digest (Blake2b 128)
forall ba a.
(ByteArrayAccess ba, HashAlgorithm a) =>
ba -> Digest a
hash :: ByteString -> Digest (Blake2b 128))
blake2_256 :: ByteString -> ByteString
{-# INLINE blake2_256 #-}
blake2_256 :: ByteString -> ByteString
blake2_256 = Digest (Blake2b 256) -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert (Digest (Blake2b 256) -> ByteString)
-> (ByteString -> Digest (Blake2b 256)) -> ByteString -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ByteString -> Digest (Blake2b 256)
forall ba a.
(ByteArrayAccess ba, HashAlgorithm a) =>
ba -> Digest a
hash :: ByteString -> Digest (Blake2b 256))
blake2_512 :: ByteString -> ByteString
{-# INLINE blake2_512 #-}
blake2_512 :: ByteString -> ByteString
blake2_512 = Digest (Blake2b 512) -> ByteString
forall bin bout.
(ByteArrayAccess bin, ByteArray bout) =>
bin -> bout
convert (Digest (Blake2b 512) -> ByteString)
-> (ByteString -> Digest (Blake2b 512)) -> ByteString -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ByteString -> Digest (Blake2b 512)
forall ba a.
(ByteArrayAccess ba, HashAlgorithm a) =>
ba -> Digest a
hash :: ByteString -> Digest (Blake2b 512))