Python implementation of cksum algorithm
Project description
pycksum - A Python implementation of the cksum algorithm
The cksum algorithm generates a checksum for a stream of data. While cksum is not cryptographically strong, it can be used to validate the integrity of transferred files.
Pycksum includes a pure Python implementation of cksum as well as an efficient C extension that will automatically be used on platforms that support it.
Installation
Install from PyPi using pip, a package manager for Python:
$ pip install pycksum
Examples
The simplest way to use pycksum is to just give it a string:
import pycksum ck = pycksum.cksum("Any string")
You can pass in a file or an iterable:
ck = pycksum.cksum( open("filename")) ck = pycksum.cksum( ["This", "love", "is", "taking", "its", "toll", "on me"])
If you have a lot of data to process, it’s more memory-efficient to calculate the cksum incrementally:
c = pycksum.Cksum() for data in input_fd: c.add(data) ck = c.get_cksum() sz = c.get_size()
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 pycksum-0.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09056c45c0bef3823e186b8426fb55f8737c28d268199de91bb5abdf2d6df210 |
|
MD5 | a653436f622a81e9579d42c8e530e83c |
|
BLAKE2b-256 | bbad51a394ea3ff64cbcc97c6caf7a6c46b61a11a4cec53aa5032be3db1abde2 |
Hashes for pycksum-0.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a4826cd6a871e72540389cd0bce4b89316c739fb9257e72fb8c8666231d5f4 |
|
MD5 | fd0f9411b860316094c709bba2f80d22 |
|
BLAKE2b-256 | 3789dbb2b1ad532a644abffae3f6fda35efca8bf9444bbd1197e36085682bded |
Hashes for pycksum-0.4.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2be2992016310a298b9b051208c2691d914f972dc1f32e478d1b9c72fcd42e0 |
|
MD5 | 2124ac644cb7c87a38279c0fbfaa6cc8 |
|
BLAKE2b-256 | 12c51c4d113cc9588e41c06593023950fb52f3ac082f47a360940ac0bc9d431e |
Hashes for pycksum-0.4.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5610c115823bea6ea34564eeccf79ebdb8d5c6237081e9d767d8be5a89dbe2 |
|
MD5 | ea3465549e89365fb19e15415c6f7a73 |
|
BLAKE2b-256 | fa24aea8b91c300d78feaa8873c90658bf0dbef0635759adbe3f33b4697cfa8c |
Hashes for pycksum-0.4.4-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98a9e6c2eda550eab44c065b3e44a779375d93dbbbdd630e68020f80ce99256 |
|
MD5 | 4955cfb4eb71a1d459c19b66ac67a0bf |
|
BLAKE2b-256 | 681427546b2be84610a96d2ab98ecd13efca764c8213c282174bc3a663bb5c19 |
Hashes for pycksum-0.4.4-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af1698938ee3ab52a87f0524591e2773c1d1c8d8e1de32ea83cdb38ddd7e6d7e |
|
MD5 | 04d870998d307747d4f74d9a89958d1d |
|
BLAKE2b-256 | 238836d3ad6598e1e1dd2522abb352683c0257fcbeec6fa9f7275c96fa4a1723 |
Hashes for pycksum-0.4.4-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f7538ca4ac49b6a5786a52a47bdef10e7394a3e6ee4615e052a1e727b55bdc |
|
MD5 | 7bdeb6603fc9e9516cf5a490a9e85742 |
|
BLAKE2b-256 | 8aa10366285fedfa17beb52e5592089c2fc5d192a9a7b2cb5761b0bebfaa1537 |
Hashes for pycksum-0.4.4-cp27-cp27m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35113d24478534c4596b57c73dfd56a148b6066fcc85291d8a4dc95131830bab |
|
MD5 | 7857d953c89e1c5da60c19d3dab8a5f9 |
|
BLAKE2b-256 | 39efb91fe62bd374d87c6c685665bb68703699ad071de138ad9f76c5f5f1ae71 |