Skip to main content

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.

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.3.6.tar.gz (14.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycksum-0.3.6.macosx-10.7-intel.tar.gz (17.8 kB view details)

Uploaded Source

pycksum-0.3.6.linux-x86_64.tar.gz (28.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pycksum-0.3.6.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pycksum-0.3.6.tar.gz
Algorithm Hash digest
SHA256 d5ce640574e71bea00f1533aaa3b418508dcb1ddf6d3dac5edd1c981a0bcb964
MD5 6ef0cffc0631f2e2c36350df1bca6058
BLAKE2b-256 82f09ea3d9bbf3239f04c18690a7756df3a2bac42405d0c97c0a6e287f188206

See more details on using hashes here.

File details

Details for the file pycksum-0.3.6.macosx-10.7-intel.tar.gz.

File metadata

File hashes

Hashes for pycksum-0.3.6.macosx-10.7-intel.tar.gz
Algorithm Hash digest
SHA256 aef2998181e3549c17ad856fbb08682de34d0bb28a1a7bb5aeb2e9b7fbe8fda8
MD5 38aa2bf78b5d511ad0af8492d8d8dee9
BLAKE2b-256 7798babeb36c455fd5dc520d3ef2f7d3707ae5d85f4b7f1878a653b298504b5e

See more details on using hashes here.

File details

Details for the file pycksum-0.3.6.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for pycksum-0.3.6.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 0b907b98ee7d27c21554dcd515e081091c3178fa8b395a281cfcb03aec4d1bef
MD5 147c08885c69bfc7cbfe5f6b8777b865
BLAKE2b-256 8af6a7175a0c69c3278ee99851ac4ac82b9820059f28298dc3cd8757075d2571

See more details on using hashes here.

Supported by

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