Skip to main content

Library for calculating CRC16

Project description

CRC is a way of detecting accidental changes in data storage or transmission. There are many variants of CRC and CRC16, in particular. This library calculates only CRC16 (16-bit codes) and the only supported variant at the moment is CRC-CCITT (XModem).

If you want to know more about CRC, is a good place to start.

If you want other variants of CRC16 supported, please make a request at

Source codes are hosted at If you want to contribute to this library, create a fork, make you changes and then create a pull request. Any help is appreciated.


On Windows you can use precompiled binaries which can be found at

On Linux and other operation systems you should compile the library from the source codes. To do this on Linux use following steps:

  • download source tarball, e.g. crc16-0.1.1.tar.gz, from

  • extract it with command:

    tar -xzf crc16-0.1.1.tar.gz
  • compile and install the library:

    cd crc16-0.1.1
    python build
    sudo python install

    you will need the administrative privileges to execute the last command.

After installation you can run unit tests to make sure that the library works fine. Execute:

python -m crc16.test


In Python 3:

import crc16

In Python 2 you should use strings instead of binary data:

import crc16

You can also calculate CRC gradually:

import crc16
crc = crc16.crc16xmodem(b'1234')
crc = crc16.crc16xmodem(b'56789', crc)

Other projects

There are a number of projects and libraries for CRC calculation. See for example:

Project details

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
crc16-0.1.1.tar.gz (9.6 kB) Copy SHA256 hash SHA256 Source None
crc16-0.1.1.win32-py2.6.exe (208.2 kB) Copy SHA256 hash SHA256 Windows Installer 2.6
crc16-0.1.1.win32-py2.7.exe (208.2 kB) Copy SHA256 hash SHA256 Windows Installer 2.7
crc16-0.1.1.win32-py3.1.exe (208.2 kB) Copy SHA256 hash SHA256 Windows Installer 3.1
crc16-0.1.1.win32-py3.2.exe (208.2 kB) Copy SHA256 hash SHA256 Windows Installer 3.2
crc16-0.1.1.win32-py3.3.exe (202.8 kB) Copy SHA256 hash SHA256 Windows Installer 3.3 (20.9 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