@@ -33,19 +33,21 @@ import Data.Binary.Get (runGet, getWord32be)
3333import Data.Maybe
3434import Data.Word (Word8)
3535
36+import qualified Data.ByteArray as BA
3637import qualified Data.ByteString as B
3738import qualified Data.ByteString.Lazy as BL
3839
3940-- |Generate a 'UUID' within the specified namespace out of the given
4041-- object.
41−generateNamed :: (B.ByteString -> B.ByteString) -- ^Hash
42+generateNamed :: BA.ByteArrayAccess bs
43+ => (B.ByteString -> bs) -- ^Hash
4244 -> Word8 -- ^Version
4345 -> UUID -- ^Namespace
4446 -> [Word8] -- ^Object
4547 -> UUID
4648generateNamed hash version namespace object =
4749 let chunk = B.pack $ toList namespace ++ object
48− bytes = BL.fromChunks . (:[]) $ hash chunk
50+ bytes = BL.fromStrict . BA.convert $ hash chunk
4951 w = getWord32be
5052 unpackBytes = runGet $
5153 buildFromWords version <$> w <*> w <*> w <*> w