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 'crc32c._crc32c_cffi' from '.../python-crc32c/venv37/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']
+ /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:
crc32c/_crc32c_cffi.abi3.so
crc32c/.dylibs/libcrc32c.dylib
/usr/lib/libc++.1.dylib:
crc32c/.dylibs/libcrc32c.dylib
@loader_path/.dylibs/libcrc32c.dylib:
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 virtualenv venv
$ venv/bin/pip install --upgrade setuptools pip wheel
$ venv/bin/pip install cmake
$ mkdir usr
$ export CRC32C_INSTALL_PREFIX=$(pwd)/usr
$ mkdir crc32c/build
$ cd 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-0.1.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57893cf04cfa924c4e75e9ba29c9878304687bd776f15fb02b6ecdb867d181a3 |
|
MD5 | e1a365412eeb3ca296921c8a2e8d3ad6 |
|
BLAKE2b-256 | ce5b9155779f6a229e4ff4c86b375021d33b615c762d53f392de520594502da9 |
Hashes for google_crc32c-0.1.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcc75bc9ef5a0ba3989408a227f4e6b609e989427727f4bca3aaad1f2ba4c98d |
|
MD5 | 8010df817aac8340be5b92fbaacb3fa8 |
|
BLAKE2b-256 | 80717175557dbed2fe07b895587a361ba6faa54e28abdc40cd7237f3f82f5e45 |
Hashes for google_crc32c-0.1.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e222263c9028dca294611af0e51371afcfc9bc4781484909d50c6ca9862807 |
|
MD5 | 6205298295924974de5fbd2d13cd1263 |
|
BLAKE2b-256 | 62a64ea4a92622ba5e9c54f648e4c390fc3c1a48fe5b121c13eb59652e24aad9 |
Hashes for google_crc32c-0.1.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e666e8cdd067ece9e7e2618634caa3aa33266da5c3e9666dd46e5d3e65b3538 |
|
MD5 | f3179682ed6ff8a5a7c516f231f26578 |
|
BLAKE2b-256 | c5cb504398aeef3267cc0ee9416ca0b7ab065b7b428a9ace5f906f8ac7a769db |
Hashes for google_crc32c-0.1.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 053abd3fed09a766a56129b2df1439cf691ac40443659e252cc2cf4ba440c0aa |
|
MD5 | ff06ba0088e2562ede97ee093d8b5432 |
|
BLAKE2b-256 | ebe871bc8a58d2d14a03128e38ad6cae56c1f84dcfafcdc2e3ae34b5bf5fd7d8 |
Hashes for google_crc32c-0.1.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79bf4d11867b3adcb8110b1fafc7d8ca7cb8ee1cd1d65ceaffef5c945188b5b8 |
|
MD5 | bc9533011b7cafeef6410437f87d19ec |
|
BLAKE2b-256 | 17cbc085dacff2ade31c47ed63b0671bc54f3f25cccd368f412042a568dcf2a6 |
Hashes for google_crc32c-0.1.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb34587503cd052495df010474cf7ff408a43efc56360b1cc7563d1a849d4798 |
|
MD5 | 3f14545e411895097f5d137277c13fa6 |
|
BLAKE2b-256 | 0db3dd6b7b6d4182a379d72f90a83d1c25fb459829210605c0712dbdea88a8f6 |
Hashes for google_crc32c-0.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af1f4ef7c649ad637e7fdd1e6e8e5a1ef28b45325064f9c8b563fe7ef8444e4c |
|
MD5 | f2cfda1d5d2bdf72beaace301c1aab05 |
|
BLAKE2b-256 | 505c721b2a671035f492747dfd5ab88bd6ffa1cdc51e32ba3e726fcc9776eb26 |
Hashes for google_crc32c-0.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c8b6ea0fa71913b0e773b311001b390110d466f0c6536bf6bad2b712d11acf5 |
|
MD5 | c3dad19311a38658572037f46785d7bc |
|
BLAKE2b-256 | db70ffb9ca776a7bb55699a0ba8f75a90191ecf27cb9b6d8edd1567da357c9ca |
Hashes for google_crc32c-0.1.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f42f3df1ac90326c1229ffb71471f1d1504f8c68fad6b627c996df732e800c6c |
|
MD5 | 9e3c3800f1cca6ba77afbfb1540e5866 |
|
BLAKE2b-256 | e996e728f53c88ccf6a3e4b86ae54c1348f7ef5f4d8506c9fa52a34dafd8fdb0 |
Hashes for google_crc32c-0.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5806e9f3602e9ab237306700ace5121c8fc7f5cc5a59054255d874123144914 |
|
MD5 | 3096fb7496fcc4a3bab4a16643771ddc |
|
BLAKE2b-256 | daab28e0fbf9ea2c8b439e6891d5ae1d0167ae455ec8a99dbbcb8c31f8a63a67 |
Hashes for google_crc32c-0.1.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7496f57ba73f63ea0b36bdab961799d03f1e5d3b972ec00b93a3c13f94bf703a |
|
MD5 | 3d4dfd149fdf55231d94e048b402df0f |
|
BLAKE2b-256 | 7bea93a823eab45dd9beed5e3018ec0bbc800454acbacef5916981594b8b0755 |
Hashes for google_crc32c-0.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b0f8b73a97be981a5b727526eb8087a8a33a103031e2ec799df66f7535a152e |
|
MD5 | c1d2ef70f4947fcfef7c1db9011fb675 |
|
BLAKE2b-256 | 53af1a3697f12a4413f14d33c9f75c35dc6fc64d89a15d2b46f7a66ebcb7a6bc |
Hashes for google_crc32c-0.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7232f2b5305f44fa5bfe01b094305cfab1ab1895091aebcc840f262ef8013271 |
|
MD5 | 86e36e5af19257b888e95c19d434ac43 |
|
BLAKE2b-256 | 0825ec7b4ef43b5316d09884f257975574924082a0f8905a1976bb3bdb8e7cb8 |
Hashes for google_crc32c-0.1.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dec850f4a4afdc8721b675c549f127c7809d6e76afebb14b1acc58f456d1e10 |
|
MD5 | 68ca60ba9d9f31246cb128e27411df89 |
|
BLAKE2b-256 | 106ebbd0c95ee982282aba3b41ed4b4a4c2540fd732fd11da66086b365708b6c |
Hashes for google_crc32c-0.1.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce91c6fd8d32ea76c6162cbb7ed493939c85b8c0da41f194f9a7784e978dd91 |
|
MD5 | dd8aed11207495d177cb7c29e54f46fb |
|
BLAKE2b-256 | d1b0a779a295ad7a554852d7a33930e03306efc13524d860209357258d3eb3d3 |
Hashes for google_crc32c-0.1.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab8d637d1467e8dd8e01f8d909c2b92102d9bf4a0e5bc4898c9c1aaccf52572 |
|
MD5 | eb6f2ef6e24cca546ec3d2ce2eba31eb |
|
BLAKE2b-256 | 5c2520f45446e9e4ada9e23a8e8decaf00bed7e7f9a127acfde32c84a2e1ecde |