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.0.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4279a040f0fa1e39a2aa945283f371b16506d8aa48599ad78cdda1421a6a58b |
|
MD5 | 8bcc3d045d0efacd27f45e4ede44c71e |
|
BLAKE2b-256 | 2138523539b8670de9994094e6c6baa8eb9f21599039f90c4d95dfe5d065c982 |
Hashes for google_crc32c-0.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be1d1f5bab5a89093e47d1d7ad2dd7f203a7983bb017e651af5b901a2d690afe |
|
MD5 | bc2cfb7611296ff3f9548c2a42132601 |
|
BLAKE2b-256 | 10511d09a7559e463c222c976c4aca160e15ed52749ebf16c6641fde51c09e92 |
Hashes for google_crc32c-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43f1899d6644560a84e82308f4fcb74b0d5bf7e4ad56542655a66ec8a711d9f2 |
|
MD5 | 6437e200f7bc754728b6e217058e89f8 |
|
BLAKE2b-256 | 0584f26f84330de0828ce5c823f52b3c06d1ce34490ff1f92e5c4762a6a9c6b7 |
Hashes for google_crc32c-0.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a96fdefb5d7ace6158dc1dc9aa2c077e7b0875bba613d3050a6aae3f38ad2cf |
|
MD5 | 809bb0380276f110fed0648a069ec8d8 |
|
BLAKE2b-256 | c97636949ee0481194666ab8ac7acc6d32e9a763a2f011b107d60e317219d82e |
Hashes for google_crc32c-0.0.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92c019dd2fdea0a94973195f74cdf24832968c65ae1f139b21f5079f72b06bc8 |
|
MD5 | fb331e944f315e1d46ae7b7e43168213 |
|
BLAKE2b-256 | 72c143b7e4710709d2a41c969d02fd031bc21739abe2c8c40b20a04f8eab9fd3 |
Hashes for google_crc32c-0.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c16cd7d9b96ca51b78f940d4f92a0707fb83108bcc65bafd4c3339487d90325 |
|
MD5 | 96770b31c555677e63a5132a33e17a17 |
|
BLAKE2b-256 | 6438e4cf9376263e01d1d5b5a6d871cb4e8c60ccb8606170059530f9a915b046 |
Hashes for google_crc32c-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84e0a13059b40171513c930a93ca2d8d5518df4c1784391f5a0806aec5bf7b08 |
|
MD5 | 7242b60611af25960395e991cef1ec83 |
|
BLAKE2b-256 | 327e734747a9b64d9042d5c2198acc90112379c4532d3b3c65a23ca4a2ba08cd |
Hashes for google_crc32c-0.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf141ee59d794e6d5331cf92ac2852dfb65e7db0f5ec1c322361b46d0de98e6c |
|
MD5 | b4bf087e596427bb00960b48db7636c5 |
|
BLAKE2b-256 | fc08f5246498fef3bb28371ae8b468f92061c7caed379606b3121e4567da5a76 |
Hashes for google_crc32c-0.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d8ecc925e0d4aa091d766595ffd35d782b1bb9ac8270227a146ccda67f37e37 |
|
MD5 | 1dd1724f2efb2496b0eb1323ba3fb2b2 |
|
BLAKE2b-256 | d6f641917301450d6a63f75aee6820996e6ef8860e0fe90a2c0b0232f4e649c3 |
Hashes for google_crc32c-0.0.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81ef7d3908414613db5fb5b680c5d8b123993cfca80c139b4a6410d176530b8c |
|
MD5 | 8a5d63830b8e9c27362cd864291897d5 |
|
BLAKE2b-256 | 7ce9fa9353b6595451c0874e0e26370cb45ff8fe8b4a36ae5017c7e0a26feeb6 |
Hashes for google_crc32c-0.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5b3295e354b3f94baf96c0187c8cee782949e541e328dfe755f9352e9ab6770 |
|
MD5 | 318b3a07808c81fc56c7f06c584e1fc1 |
|
BLAKE2b-256 | 43ff6923968437b9be807305b4af1bb030ff6dc74f08314f38d5e9035e9788cf |
Hashes for google_crc32c-0.0.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f1df27425a93e4a49aefe1cd4989af2c6ddf9728c5b41357e1d6929020ffb1 |
|
MD5 | 4dcb7dbedf8028494b5dd4ce7c6e57c5 |
|
BLAKE2b-256 | 26e059bc6d034b4e3434fdbf80cf4a27ccc3a8dc2528458662dd99e156021564 |
Hashes for google_crc32c-0.0.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff74e5986c0f63df2f4552f1ed3e68572b3ed8e93fb33f6f77b1acdd69e86064 |
|
MD5 | 40567422de5b5f6b1d6a9694c5cacc34 |
|
BLAKE2b-256 | a612a91e5e4f19c815072976cf41b769ff0cae90d350f4bfd4979f742633c698 |
Hashes for google_crc32c-0.0.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f742b28098021630a305d45d9a24bd1132cbe5a12a81aaa5435525d3867802aa |
|
MD5 | 74e25a370c587460eacc08ef7f3beeb6 |
|
BLAKE2b-256 | b72bf60dd1d030edd91bb73b360a7ec46e78400578a769baa9b012c09c421523 |
Hashes for google_crc32c-0.0.2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12fb64477ba58fa052be2cbed7f51095f3c8b33cd39ebfa24715032dc24d1a7f |
|
MD5 | c079a70b85b70f477654354781aee391 |
|
BLAKE2b-256 | 8a5528fb5ffe4159912eb673f24e7af226de9735966a67275619a2b3e89e1b82 |
Hashes for google_crc32c-0.0.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5d75d5f15100b9e2add22846cb5a953e66609d619f7a1ca2c1733846b7e9905 |
|
MD5 | c4a0588f52238c3798ab65ebc51e9031 |
|
BLAKE2b-256 | 48b829dd2b3c01c91eb094067de967e6cabad5aef60b10608ff161ce099481c0 |
Hashes for google_crc32c-0.0.2-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 975e70e23848bae7ddf52e37a491061d0236d5a76a72b28d3b98516f056887ef |
|
MD5 | c7b7b7a3d3d6b63c2100ec0a949c55a3 |
|
BLAKE2b-256 | e062438d6527b01baab0166823666c053d47420db919f3fcdb47990dec44e612 |