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()
Metadata
Release files for pycksum 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pycksum-0.6.1.tar.gz | 65.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycksum-0.6.1-cp315-cp315-macosx_10_15_x86_64.whl | CPython 3.15 | CPython 3.15 | macOS 10.15+ x86-64 | Details |
Total release size: 88.8 kB
Release files / pycksum-0.6.1.tar.gz
| Download URL | pycksum-0.6.1.tar.gz |
|---|---|
| Size | 65.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5561bcdf337fb1b1e0e9f02f8cade88ee727b13b2de2d13296c926cd21cd6b3e
|
|
BLAKE2b-256 checksum How to use checksums |
0214d543d37468488d38133d1f3ca331aefc016410d4222e969341b1d52eeec5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pycksum-0.6.1-cp315-cp315-macosx_10_15_x86_64.whl
| Download URL | pycksum-0.6.1-cp315-cp315-macosx_10_15_x86_64.whl |
|---|---|
| Size | 23.7 kB |
| Tags | CPython 3.15 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
ae5b736675881fd56a98090a46220555e4edb62df20b4c17df919f15ddf798db
|
|
BLAKE2b-256 checksum How to use checksums |
1f4b6b5f84b6770738516046b4da93f73a4d6488d8b30e8618f2ed5b779ca21f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|