diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Revision history for sha1
 
+## 0.1.1.0 -- 2023-07-27
+
+* Add function for encoding to `ByteArrayN`.
+
 ## 0.1.0.2 -- 2020-03-09
 
 * Add proper attribution to license file.
diff --git a/sha1.cabal b/sha1.cabal
--- a/sha1.cabal
+++ b/sha1.cabal
@@ -1,6 +1,6 @@
 cabal-version: 2.2
 name: sha1
-version: 0.1.0.2
+version: 0.1.1.0
 synopsis: SHA-1 Hash
 description:
   This library is a copy of cryptohash-sha1 that works on GC-managed
@@ -30,7 +30,8 @@
     , base >=4.12 && <5
     , primitive >=0.7 && <0.8
     , bytebuild >=0.3.4 && <0.4
-    , byteslice >=0.2.2 && <0.3
+    , byteslice >=0.2.11.1 && <0.3
+    , run-st >=0.1.3
   default-language: Haskell2010
   ghc-options: -O2 -Wall
 
@@ -41,9 +42,9 @@
   type: exitcode-stdio-1.0
   build-depends:
     , base
-    , sha1
+    , bytebuild >=0.3.4
+    , byteslice >=0.1.4.0
     , natural-arithmetic >=0.1.1
-    , small-bytearray-builder
     , primitive
-    , byteslice >=0.1.4.0
+    , sha1
   ghc-options: -O2 -Wall
diff --git a/src/Hash/Sha1.hs b/src/Hash/Sha1.hs
--- a/src/Hash/Sha1.hs
+++ b/src/Hash/Sha1.hs
@@ -4,16 +4,20 @@
 
 module Hash.Sha1
   ( boundedBuilder
+  , byteArrayN
   ) where
 
 import Control.Monad.ST (ST)
+import Control.Monad.ST.Run (runByteArrayST)
 import Data.Bytes.Builder.Bounded as BB
 import Data.Bytes.Builder.Bounded.Unsafe as BBU
-import Data.Bytes.Types (Bytes(Bytes))
+import Data.Bytes.Types (Bytes(Bytes),ByteArrayN(ByteArrayN))
 import Data.Primitive (ByteArray(..),MutableByteArray(..))
 import GHC.Exts (Int(I#),Int#,MutableByteArray#,ByteArray#)
 import GHC.IO (unsafeIOToST)
 
+import qualified Data.Primitive as PM
+
 foreign import ccall unsafe "sha1.h hs_cryptohash_sha1_onepass"
   c_hash :: MutableByteArray# s -> Int# -> ByteArray# -> Int# -> Int# -> IO ()
 
@@ -21,9 +25,18 @@
 performHash (MutableByteArray x) (I# a) (ByteArray y) (I# b) (I# c) =
   unsafeIOToST (c_hash x a y b c)
 
+-- | Hash the byte sequence, returning the result as a builder.
 boundedBuilder :: Bytes -> BB.Builder 20
 boundedBuilder (Bytes arr off len) = BBU.construct
   (\buf ix -> do
     performHash buf ix arr off len
     pure (ix + 20)
   )
+
+-- | Hash the byte sequence, returning the result as a byte array
+-- known to have exactly 20 bytes.
+byteArrayN :: Bytes -> ByteArrayN 20
+byteArrayN (Bytes arr off len) = ByteArrayN $ runByteArrayST $ do
+  dst <- PM.newByteArray 20
+  performHash dst 0 arr off len
+  PM.unsafeFreezeByteArray dst
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -5,7 +5,7 @@
 import Numeric (showHex)
 
 import qualified Arithmetic.Nat as Nat
-import qualified Data.ByteArray.Builder.Bounded as BB
+import qualified Data.Bytes.Builder.Bounded as BB
 import qualified Data.Bytes as Bytes
 import qualified Data.Primitive as PM
 import qualified GHC.Exts as Exts
