Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit f05e95c

Browse files
author
Hubert Hesse
committed
Switch file hashing to xxhash
Change-Id: I7104c68d9f3023e55ae9ce5137742e31e6356f1a
1 parent 2e4abc9 commit f05e95c

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

README.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Installation
2121

2222
Python 3.3+ is required.
2323

24+
Install dependencies
25+
^^^^^^^^^^^^^^^^^^^^
26+
27+
clcache uses https://pypi.python.org/pypi/xxhash[xxhash] for file hashing.
28+
Install it via:
29+
30+
pip install xxhash
31+
2432
Installation via exe
2533
^^^^^^^^^^^^^^^^^^^^
2634

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ install:
4242
- pip install codecov
4343
- coverage --version
4444

45+
# Install xxhash python bindings
46+
- pip install xxhash
47+
4548
build_script:
4649
- python clcache.py --help
4750
- python clcache.py -s

clcache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
import codecs
1414
import contextlib
1515
import errno
16-
import hashlib
1716
import json
1817
import multiprocessing
1918
import os
2019
import re
2120
import signal
2221
import subprocess
2322
import sys
23+
import xxhash
2424
from tempfile import TemporaryFile
2525

2626
VERSION = "3.3.1-dev"
2727

28-
HashAlgorithm = hashlib.md5
28+
HashAlgorithm = xxhash.xxh64
2929

3030
# try to use os.scandir or scandir.scandir
3131
# fall back to os.listdir if not found
@@ -192,7 +192,7 @@ class ManifestRepository(object):
192192
# invalidation, such that a manifest that was stored using the old format is not
193193
# interpreted using the new format. Instead the old file will not be touched
194194
# again due to a new manifest hash and is cleaned away after some time.
195-
MANIFEST_FILE_FORMAT_VERSION = 6
195+
MANIFEST_FILE_FORMAT_VERSION = 7
196196

197197
def __init__(self, manifestsRootDir):
198198
self._manifestsRootDir = manifestsRootDir

0 commit comments

Comments
 (0)