diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,9 @@
+0.3.10 [2023.08.06]
+-------------------
+* Allow building with `bytestring-0.12.*`.
+* Replace a use of `bytestring`'s `memset` function (which is now deprecated as
+  of `bytestring-0.12.*`) with `base`'s `fillBytes` function.
+
 0.3.9 [2021.11.01]
 ------------------
 * Allow building with GHC 9.2.
diff --git a/charset.cabal b/charset.cabal
--- a/charset.cabal
+++ b/charset.cabal
@@ -1,5 +1,5 @@
 name:          charset
-version:       0.3.9
+version:       0.3.10
 license:       BSD3
 license-File:  LICENSE
 copyright:     (c) Edward Kmett 2010-2012
@@ -28,8 +28,10 @@
    || ==8.6.5
    || ==8.8.4
    || ==8.10.7
-   || ==9.0.1
-   || ==9.2.1
+   || ==9.0.2
+   || ==9.2.7
+   || ==9.4.5
+   || ==9.6.2
 
 source-repository head
   type: git
@@ -42,7 +44,7 @@
   build-depends:
     base                 >= 4       && < 5,
     array                >= 0.2     && < 0.6,
-    bytestring           >= 0.9     && < 0.12,
+    bytestring           >= 0.9     && < 0.13,
     containers           >= 0.2     && < 0.7,
     unordered-containers >= 0.1.4.6 && < 0.3
   if impl(ghc < 8.0)
diff --git a/src/Data/CharSet/ByteSet.hs b/src/Data/CharSet/ByteSet.hs
--- a/src/Data/CharSet/ByteSet.hs
+++ b/src/Data/CharSet/ByteSet.hs
@@ -44,6 +44,10 @@
 import qualified Data.ByteString.Internal as I
 import qualified Data.ByteString.Unsafe as U
 
+#if MIN_VERSION_base(4,8,0)
+import Foreign.Marshal.Utils (fillBytes)
+#endif
+
 newtype ByteSet = ByteSet B.ByteString deriving (Eq, Ord, Show)
 
 -- | Representation of the index of a bit inside a bytestring
@@ -65,7 +69,12 @@
 
 fromList :: [Word8] -> ByteSet
 fromList s0 = ByteSet $ I.unsafeCreate 32 $ \t -> do
-  _ <- I.memset t 0 32
+  _ <-
+#if MIN_VERSION_base(4,8,0)
+    fillBytes t 0 32
+#else
+    I.memset t 0 32
+#endif
   let go [] = return ()
       go (c:cs) = do
         prev <- peekByteOff t byte :: IO Word8
