Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python implementation of cksum algorithm

Project description

pycksum - A Python implementation of the cksum algorithm

Build Status

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.


Install from PyPi using pip, a package manager for Python:

$ pip install pycksum


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:
ck = c.get_cksum()
sz = c.get_size()

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pycksum-0.4.0.tar.gz (15.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page