diff --git a/pre_commit_hooks/requirements_txt_fixer.py b/pre_commit_hooks/requirements_txt_fixer.py
index dc41815..6190692 100644
--- a/pre_commit_hooks/requirements_txt_fixer.py
+++ b/pre_commit_hooks/requirements_txt_fixer.py
@@ -34,6 +34,18 @@ class Requirement:
         else:
             return self.name < requirement.name
 
+    def is_complete(self) -> bool:
+        return (
+            self.value is not None and
+            not self.value.rstrip(b'\r\n').endswith(b'\\')
+        )
+
+    def append_value(self, value: bytes) -> None:
+        if self.value is not None:
+            self.value += value
+        else:
+            self.value = value
+
 
 def fix_requirements(f: IO[bytes]) -> int:
     requirements: List[Requirement] = []
@@ -55,7 +67,7 @@ def fix_requirements(f: IO[bytes]) -> int:
         # If the most recent requirement object has a value, then it's
         # time to start building the next requirement object.
 
-        if not len(requirements) or requirements[-1].value is not None:
+        if not len(requirements) or requirements[-1].is_complete():
             requirements.append(Requirement())
 
         requirement = requirements[-1]
@@ -73,7 +85,7 @@ def fix_requirements(f: IO[bytes]) -> int:
         elif line.startswith(b'#') or line.strip() == b'':
             requirement.comments.append(line)
         else:
-            requirement.value = line
+            requirement.append_value(line)
 
     # if a file ends in a comment, preserve it at the end
     if requirements[-1].value is None:

requirements-txt-fixer does not handle multiline dependencies
Given:
```
distlib==0.3.0 \
    --hash=sha256:2e166e231a26b36d6dfe35a48c4464346620f8645ed0ace01ee31822b288de21
appdirs==1.4.3 \
    --hash=sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92 \
    --hash=sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e
filelock==3.0.12 \
    --hash=sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59 \
    --hash=sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836
```

requirements-txt-fixer will move all `--hash` lines on top of the file.
diff --git a/tests/requirements_txt_fixer_test.py b/tests/requirements_txt_fixer_test.py
index 7b9b07d..17a9a41 100644
--- a/tests/requirements_txt_fixer_test.py
+++ b/tests/requirements_txt_fixer_test.py
@@ -50,6 +50,24 @@ from pre_commit_hooks.requirements_txt_fixer import Requirement
             FAIL,
             b'Django\nijk\ngit+ssh://git_url@tag#egg=ocflib\n',
         ),
+        (
+            b'b==1.0.0\n'
+            b'c=2.0.0 \\\n'
+            b' --hash=sha256:abcd\n'
+            b'a=3.0.0 \\\n'
+            b'  --hash=sha256:a1b1c1d1',
+            FAIL,
+            b'a=3.0.0 \\\n'
+            b'  --hash=sha256:a1b1c1d1\n'
+            b'b==1.0.0\n'
+            b'c=2.0.0 \\\n'
+            b' --hash=sha256:abcd\n',
+        ),
+        (
+            b'a=2.0.0 \\\n --hash=sha256:abcd\nb==1.0.0\n',
+            PASS,
+            b'a=2.0.0 \\\n --hash=sha256:abcd\nb==1.0.0\n',
+        ),
     ),
 )
 def test_integration(input_s, expected_retval, output, tmpdir):

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cfgv==3.4.0
covdefaults==2.3.0
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.18.0
flake8==7.2.0
identify==2.6.9
iniconfig==2.1.0
mccabe==0.7.0
nodeenv==1.9.1
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pre_commit==4.2.0
-e git+https://github.com/pre-commit/pre-commit-hooks.git@41e26ab636aab10b8b367c9654d606604c0e5da8#egg=pre_commit_hooks
pycodestyle==2.13.0
pyflakes==3.3.1
pytest==8.3.5
PyYAML==6.0.2
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.12
toml==0.10.2
tomli==2.2.1
virtualenv==20.29.3

name: pre-commit-hooks
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cfgv==3.4.0
      - covdefaults==2.3.0
      - coverage==7.8.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==7.2.0
      - identify==2.6.9
      - iniconfig==2.1.0
      - mccabe==0.7.0
      - nodeenv==1.9.1
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pre-commit==4.2.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pytest==8.3.5
      - pyyaml==6.0.2
      - ruamel-yaml==0.18.10
      - ruamel-yaml-clib==0.2.12
      - toml==0.10.2
      - tomli==2.2.1
      - virtualenv==20.29.3
prefix: /opt/conda/envs/pre-commit-hooks

tests/requirements_txt_fixer_test.py::test_integration[b==1.0.0\nc=2.0.0 tests/requirements_txt_fixer_test.py::test_integration[a=2.0.0
tests/requirements_txt_fixer_test.py::test_integration[-0-] tests/requirements_txt_fixer_test.py::test_integration[\n-0-\n] tests/requirements_txt_fixer_test.py::test_integration[# tests/requirements_txt_fixer_test.py::test_integration[foo\n# tests/requirements_txt_fixer_test.py::test_integration[foo\nbar\n-1-bar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[bar\nfoo\n-0-bar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[a\nc\nb\n-1-a\nb\nc\n] tests/requirements_txt_fixer_test.py::test_integration[a\nc\nb-1-a\nb\nc\n] tests/requirements_txt_fixer_test.py::test_integration[a\nb\nc-1-a\nb\nc\n] tests/requirements_txt_fixer_test.py::test_integration[#comment1\nfoo\n#comment2\nbar\n-1-#comment2\nbar\n#comment1\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[#comment1\nbar\n#comment2\nfoo\n-0-#comment1\nbar\n#comment2\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[#comment\n\nfoo\nbar\n-1-#comment\n\nbar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[#comment\n\nbar\nfoo\n-0-#comment\n\nbar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[\nfoo\nbar\n-1-bar\n\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[\nbar\nfoo\n-0-\nbar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[pyramid==1\npyramid-foo==2\n-0-pyramid==1\npyramid-foo==2\n] tests/requirements_txt_fixer_test.py::test_integration[ocflib\nDjango\nPyMySQL\n-1-Django\nocflib\nPyMySQL\n] tests/requirements_txt_fixer_test.py::test_integration[-e tests/requirements_txt_fixer_test.py::test_integration[bar\npkg-resources==0.0.0\nfoo\n-1-bar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[foo\npkg-resources==0.0.0\nbar\n-1-bar\nfoo\n] tests/requirements_txt_fixer_test.py::test_integration[git+ssh://git_url@tag#egg=ocflib\nDjango\nijk\n-1-Django\nijk\ngit+ssh://git_url@tag#egg=ocflib\n] tests/requirements_txt_fixer_test.py::test_requirement_object
pre_commit_hooks/requirements_txt_fixer.py
pre_commit_hooks/requirements_txt_fixer.py