A python wrapper of the C library 'Google CRC32C'
Project description
google-crc32c
This package wraps the google/crc32c
hardware-based implementation of the CRC32C hashing algorithm. Multiple wheels
are distributed as well as source. If a wheel is not published for the python
version and platform you are using, you will need to compile crc32c using a
C toolchain.
Building
Be sure to check out all submodules:
$ git clone --recursive https://github.com/googleapis/python-crc32c
Prerequisites
On Linux:
docker
python3.7
On OS X:
make
- Official
python.org
Python 2.7, 3.5, 3.6 and 3.7
On Windows:
cmake
- Official
python.org
Python 3.5, 3.6 and 3.7 - Visual Studio 15 2017 (just the compiler toolchain)
Unfortunately, libcrc32c
relies on many C++11 features, so
building a Python 2.7 extension with the
Visual C++ Compiler for Python 2.7 is infeasible.
Building Wheels
On Linux:
./scripts/manylinux/build.sh
On OS X:
./scripts/osx/build.sh
On Windows: see .appveyor.yml
.
Testing/Verify Wheels
On Linux (i.e. a host OS, not a docker
container):
$ ./scripts/manylinux/check-37.sh
...
+ venv/bin/python check_cffi_crc32c.py
_crc32c_cffi: <module 'crc32c._crc32c_cffi' from '.../python-crc32c/venv/lib/python3.7/site-packages/crc32c/_crc32c_cffi.abi3.so'>
_crc32c_cffi.lib: <Lib object for 'crc32c._crc32c_cffi'>
dir(_crc32c_cffi.lib): ['crc32c_extend', 'crc32c_value']
+ unzip -l wheels/google_crc32c-0.0.1-cp37-cp37m-manylinux1_x86_64.whl
Archive: wheels/google_crc32c-0.0.1-cp37-cp37m-manylinux1_x86_64.whl
Length Date Time Name
--------- ---------- ----- ----
26120 2018-10-25 00:09 crc32c/_crc32c_cffi.abi3.so
765 2018-10-24 23:57 crc32c/__init__.py
29552 2018-10-25 00:09 crc32c/.libs/libcrc32c-f865a225.so
109 2018-10-25 00:09 google_crc32c-0.0.1.dist-info/WHEEL
766 2018-10-25 00:09 google_crc32c-0.0.1.dist-info/METADATA
652 2018-10-25 00:09 google_crc32c-0.0.1.dist-info/RECORD
1 2018-10-25 00:09 google_crc32c-0.0.1.dist-info/zip-safe
7 2018-10-25 00:09 google_crc32c-0.0.1.dist-info/top_level.txt
--------- -------
57972 8 files
...
On OS X:
$ ./scripts/osx/check.sh
...
+ venv37/bin/python .../python-crc32c/check_cffi_crc32c.py
_crc32c_cffi: <module 'google_crc32c._crc32c_cffi' from '.../python-crc32c/venv37/lib/python3.7/site-packages/google_crc32c/_crc32c_cffi.abi3.so'>
_crc32c_cffi.lib: <Lib object for 'google_crc32c._crc32c_cffi'>
dir(_crc32c_cffi.lib): ['crc32c_extend', 'crc32c_value']
+ /Library/Frameworks/Python.framework/Versions/3.7/bin/delocate-listdeps --all --depending .../python-crc32c/wheels/google_crc32c-0.0.1-cp37-cp37m-macosx_10_6_intel.whl
/usr/lib/libSystem.B.dylib:
google_crc32c/_crc32c_cffi.abi3.so
google_crc32c/.dylibs/libcrc32c.dylib
/usr/lib/libc++.1.dylib:
google_crc32c/.dylibs/libcrc32c.dylib
@loader_path/.dylibs/libcrc32c.dylib:
google_crc32c/_crc32c_cffi.abi3.so
...
On Windows: TBD.
Installing locally for testing
Initialize the submodules and build the main libcrc32c.so
shared
library using cmake
/ make
:
$ cd python-crc32c
$ git submodule update --init --recursive
$ python -m venv venv
$ venv/bin/pip install --upgrade setuptools pip wheel
$ venv/bin/pip install cmake
$ mkdir usr
$ export CRC32C_INSTALL_PREFIX=$(pwd)/usr
$ mkdir google_crc32c/build
$ cd google_crc32c/build
$ ../../venv/bin/cmake \
> -DCRC32C_BUILD_TESTS=no \
> -DCRC32C_BUILD_BENCHMARKS=no \
> -DBUILD_SHARED_LIBS=yes \
> -DCMAKE_INSTALL_PREFIX:PATH=${CRC32C_INSTALL_PREFIX} \
> ..
$ make all install
$ cd ../..
Now, run the tests:
$ venv/bin/pip install -e .[testing]
$ venv/bin/py.test tests/
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-3.10.0, py-1.7.0, pluggy-0.8.0
rootdir: ..., inifile:
collected 9 items
tests/test___init__.py ......... [100%]
=========================== 9 passed in 0.03 seconds ===========================
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for google_crc32c-1.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41fb6c22cd72ae3db4d98d28dbb768d53397c8fc3cb8ab945fd434e842e622d4 |
|
MD5 | b2d2656ee7476b18c6704af6c9dae25b |
|
BLAKE2b-256 | fbc5941273f7158a0870c0d97d93109e523d1c22d193945e16bf7af7a453fa26 |
Hashes for google_crc32c-1.0.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf373207380e54c42da6c88baf1f7a31c2d9f29b87c9c922d5147d219eed55aa |
|
MD5 | 60fd154b3909f3e797bfe1b604da8313 |
|
BLAKE2b-256 | b2e164be51af77749e3a19ddbcfca32c40d54ab831faedae815617eb93513399 |
Hashes for google_crc32c-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17223ac9135eab28e874ff1e221810190d109a1abd482451d0776dc388be14de |
|
MD5 | d438c3d26ae1a9906a7b4919adbaa8a4 |
|
BLAKE2b-256 | 60403e98a8f47a3573affeabc282bd96dea24fa9a041a284d3100e2236b03286 |
Hashes for google_crc32c-1.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec4d91c9236b0576d9d2b23c7eb85c6a6372b88afe2d0c64681cf11629586f74 |
|
MD5 | 6358e1d9daebfcfaa1f58b3d105f8d41 |
|
BLAKE2b-256 | 49ed7122a6926884b2ae51858801e2cd1c707c32fae3fe5a8532a586a4cc307e |
Hashes for google_crc32c-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54c90058e3f56e55fa0f699c6f4ceaaa825ea7f17ef2adbf07b2b06b27455e7 |
|
MD5 | d934cdc59a153ec51abea0d3b03f935c |
|
BLAKE2b-256 | d41622b8eac72954d853a0541651f7634067d6ccdbe26940b0b6e79eb6b182a0 |
Hashes for google_crc32c-1.0.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 337566ce49d7ea7493f95bd6bc89ab08640caa91b6105cea0be57ed026980e74 |
|
MD5 | 7d8c9a546598373bac782147958135ca |
|
BLAKE2b-256 | ac52d9b6eb1c496bed953c2e23cc39dc4d910af8c3e15ccb5e267c381e1429eb |
Hashes for google_crc32c-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f44c5259f6b2f8b2b6f668dbaa954693a10e97811345c193e46b933c2dd5165 |
|
MD5 | 7e22c87213f253d140ae3686beec9170 |
|
BLAKE2b-256 | 25df142a642732ec36db0c9ee273660ec98bf123306a10602805fae4515bd474 |
Hashes for google_crc32c-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cda3a6829e8b5bf6058615e53387430d004590c9b0ad808e53fea5bec35bbe44 |
|
MD5 | 428befea76a54aa54e120c62f20ab191 |
|
BLAKE2b-256 | 393e627ef5d6f378a62c33e88567bd6f93d2ecd2e36997d2bce73cd703954181 |
Hashes for google_crc32c-1.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd5d861421c37786b9c1a87dc7b0d8349a426151a461d5724b76c5a07f6ae9b |
|
MD5 | 267eabc829f50eaf272ce21c329ffa87 |
|
BLAKE2b-256 | 10fcc597174578e26b5469f7b015c12acd52a2f4b7a89e0320c78f45c4eddb6e |
Hashes for google_crc32c-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 438d6c314a52d50a9523460024e655a3d27774adde47d72eebccc89dc9eec992 |
|
MD5 | 3bec812980bfaa400e23a875cbc4cf82 |
|
BLAKE2b-256 | 724a399443af2bb5596c5ea1f575c39b8a0e3d6823e31fa6de2bee9bffc84553 |
Hashes for google_crc32c-1.0.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b34d4c9ac565b2be553f81f58e5861e51d43af2043ed7cbfe1853ee2f54671 |
|
MD5 | 25895899b410ac6be69bd27e19dc5db3 |
|
BLAKE2b-256 | 00dec322008bfd1b3c9aa0088b393fc1651b937d6d5077f7b4a530bfef69d44f |
Hashes for google_crc32c-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6fad0842a02abd270f8b660db082d37d197ab80aa4db6a2ddbfcf472eade9e7 |
|
MD5 | ac2ae790fcdff61fa4dd6cdabc4bb5e9 |
|
BLAKE2b-256 | 60ed2e610dd37a6df03db022faab12a6241b4576cbf7c5b5360e2730b9a7d6fa |
Hashes for google_crc32c-1.0.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 176cef33c9ad2a56977efd084646b378e50ab14b43a7c0a16e956bc3e3ec130a |
|
MD5 | 8d2d93b1295712b8ccc9c7d0cd1b04f8 |
|
BLAKE2b-256 | da6b43c955c93876294d9aaf6f64820f768c9216cfb014dfed77f1fa83f211af |
Hashes for google_crc32c-1.0.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7ee33659231c8205bb05559781ac61a325f31b06b917b3e997bea5c2c49ff4d |
|
MD5 | 5e307947710eefb21035de4ed3a90b73 |
|
BLAKE2b-256 | 3186e7d44b3b98db21467cfd1d01f18a258b19f09206511d64348f19eaa2b94c |
Hashes for google_crc32c-1.0.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a613f43534c9a345cc86fc6531bda477e2473cb876b6e26aee22b8060917069 |
|
MD5 | 7c901051c7cfaeb76451beae173ed8eb |
|
BLAKE2b-256 | 6df607487a4ba88c87ffd0bc8fd52cb7b5b91d42c053269c10199dcea8ed3c88 |
Hashes for google_crc32c-1.0.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3b859200c3bc73925b1719ed8b1f6d8d73b6620b42dbc121c4df58423045e34 |
|
MD5 | 6b86b04c1491ffe375eb66990846f33e |
|
BLAKE2b-256 | 1a09d76a5645ebe9d70c31bfd68dec80135c1f26fe80a6d96f38dae80f9c7535 |
Hashes for google_crc32c-1.0.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5ccdc7697ca54351d2965d4241f907d53f26f5288710bed505f8c3776ed235 |
|
MD5 | 9607000118950c25fa135ff0034296eb |
|
BLAKE2b-256 | bedeeb65d1d9ab0e3a3da01497ba336c4165b34a7336cdeebc0da9479eb54a63 |