Skip to main content

Python implementation of cksum algorithm

Project description

pycksum - A Python implementation of the cksum algorithm

Build Status PyPi

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycksum-0.4.4.tar.gz (16.9 kB view details)

Uploaded Source

Built Distributions

pycksum-0.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (29.1 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (29.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (29.6 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (28.5 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (28.4 kB view details)

Uploaded CPython 3.5m manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl (27.1 kB view details)

Uploaded CPython 2.7mu manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (27.1 kB view details)

Uploaded CPython 2.7m manylinux: glibc 2.5+ x86-64

pycksum-0.4.4-cp27-cp27m-macosx_10_15_x86_64.whl (12.3 kB view details)

Uploaded CPython 2.7m macOS 10.15+ x86-64

File details

Details for the file pycksum-0.4.4.tar.gz.

File metadata

  • Download URL: pycksum-0.4.4.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.4

File hashes

Hashes for pycksum-0.4.4.tar.gz
Algorithm Hash digest
SHA256 a3a02b59dad5f75397434be2fed611270b6950a5f44d2d20a3493ebc77a22d1c
MD5 df0a0a262766d5917594d0a5ac9a6f62
BLAKE2b-256 1c7fc1df7c9ebeb279efbb76cce1465c5f9574a2dd26dbb724c92c7117685c29

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pycksum-0.4.4-cp27-cp27m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: pycksum-0.4.4-cp27-cp27m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: CPython 2.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.4

File hashes

Hashes for pycksum-0.4.4-cp27-cp27m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 35113d24478534c4596b57c73dfd56a148b6066fcc85291d8a4dc95131830bab
MD5 7857d953c89e1c5da60c19d3dab8a5f9
BLAKE2b-256 39efb91fe62bd374d87c6c685665bb68703699ad071de138ad9f76c5f5f1ae71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page