diff --git a/README.rst b/README.rst
index 965e63c..984d968 100644
--- a/README.rst
+++ b/README.rst
@@ -185,6 +185,11 @@ put it directly into ``pip``.
 Version History
 ===============
 
+0.11.0
+  * Cope with leading zeros in version numbers when figuring out what
+    the latest version is.
+    See https://github.com/peterbe/hashin/issues/39
+
 0.10.0
   * Latest version is now figured out by looking at all version numbers
     in the list of releases from the JSON payload. The pre releases are
diff --git a/hashin.py b/hashin.py
index c6c778e..6d05a41 100755
--- a/hashin.py
+++ b/hashin.py
@@ -186,10 +186,10 @@ def get_latest_version(data):
     for version in data['releases']:
         v = parse(version)
         if not v.is_prerelease:
-            all_versions.append(v)
+            all_versions.append((v, version))
     all_versions.sort(reverse=True)
     # return the highest non-pre-release version
-    return str(all_versions[0])
+    return str(all_versions[0][1])
 
 
 def expand_python_version(version):
diff --git a/setup.py b/setup.py
index c90df58..d8ed11b 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ except ImportError:
 
 setup(
     name='hashin',
-    version='0.10.0',
+    version='0.11.0',
     description='Edits your requirements.txt by hashing them in',
     long_description=open(path.join(_here, 'README.rst')).read(),
     author='Peter Bengtsson',

hashin cannot handle leading zeros in package version numbers
Pip can install packages with a missing leading zero in the version number e.g. `Unidecode==0.04.20`:

I was passing the output of `pip freeze` into `hashin` and encountered this problem.

```
/tmp > bin/pip install Unidecode==0.4.20  # or Unidecode==0.04.20
Collecting Unidecode==0.4.20
  Using cached Unidecode-0.04.20-py2.py3-none-any.whl
Installing collected packages: Unidecode
Successfully installed Unidecode-0.4.20
/tmp > bin/pip freeze
Unidecode==0.4.20
```
But hashin cannot handle this.
```
/tmp > bin/hashin Unidecode==0.4.20
Traceback (most recent call last):
  File "bin/hashin", line 11, in <module>
    sys.exit(main())
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 400, in main
    verbose=args.verbose,
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 96, in run
    run_single_package(spec, *args, **kwargs)
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 119, in run_single_package
    algorithm=algorithm
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 363, in get_package_hashes
    raise PackageError('No data found for version {0}'.format(version))
hashin.PackageError: No data found for version 0.4.20
```

diff --git a/tests/test_cli.py b/tests/test_cli.py
index 831697d..a9e2757 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -91,6 +91,20 @@ class Tests(TestCase):
         })
         self.assertEqual(version, '0.999')
 
+    @mock.patch('hashin.urlopen')
+    def test_get_latest_version_non_pre_release_leading_zeros(self, murlopen):
+        version = hashin.get_latest_version({
+            'info': {
+                'version': '0.3',
+            },
+            'releases': {
+                '0.04.13': {},
+                '0.04.21': {},
+                '0.04.09': {},
+            }
+        })
+        self.assertEqual(version, '0.04.21')
+
     @mock.patch('hashin.urlopen')
     def test_get_hashes_error(self, murlopen):
 

pip install -e .
parse_log_pytest
pytest
nose mock pytest
3.5
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
-e git+https://github.com/peterbe/hashin.git@150daa03f4ec17544d93aa9e66a06d1adc45bf26#egg=hashin
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
mock==5.2.0
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
nose==1.3.7
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: hashin
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
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - mock==5.2.0
      - nose==1.3.7
prefix: /opt/conda/envs/hashin

tests/test_cli.py::Tests::test_get_latest_version_non_pre_release_leading_zeros
tests/test_cli.py::Tests::test_as_library tests/test_cli.py::Tests::test_run tests/test_cli.py::Tests::test_run_case_insensitive tests/test_cli.py::Tests::test_run_contained_names
tests/test_cli.py::Tests::test_amend_requirements_content_new tests/test_cli.py::Tests::test_amend_requirements_content_new_similar_name tests/test_cli.py::Tests::test_amend_requirements_content_replacement tests/test_cli.py::Tests::test_amend_requirements_content_replacement_2 tests/test_cli.py::Tests::test_amend_requirements_content_replacement_amonst_others tests/test_cli.py::Tests::test_amend_requirements_content_replacement_amonst_others_2 tests/test_cli.py::Tests::test_amend_requirements_content_replacement_single_to_multi tests/test_cli.py::Tests::test_expand_python_version tests/test_cli.py::Tests::test_filter_releases tests/test_cli.py::Tests::test_get_hashes_error tests/test_cli.py::Tests::test_get_latest_version_non_pre_release tests/test_cli.py::Tests::test_get_latest_version_simple tests/test_cli.py::Tests::test_release_url_metadata_python
README.rst hashin.py setup.py
README.rst hashin.py setup.py