{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Safe #-}
module Data.RedisBloom.Hash
(
hashFamilySimple, hashFamilyFNV1, hashFamilyFNV1a,
module Data.RedisBloom.Hash.Families
)
where
import Data.Hashable
import Data.RedisBloom.Hash.Families
import Data.RedisBloom.Hash.FNV
import Data.RedisBloom.Internal
makeFromHashable :: Hashable a => RawHashFunction Int -> HashCount -> HashFamily a
makeFromHashable f = makeHashFamily $ f . hashWithSalt salt
where
salt = 5534023222112865484
hashFamilySimple, hashFamilyFNV1, hashFamilyFNV1a :: Hashable a => HashCount -> HashFamily a
hashFamilySimple = makeFromHashable fromIntegral
hashFamilyFNV1 = makeFromHashable fnv1
hashFamilyFNV1a = makeFromHashable fnv1a