Git Product home page Git Product logo

crc32's Introduction

CRC32 Tools

Build Status Coverage Status PyPI

License

This project is licensed under the GPL v3 license.

Usage

Run the command line to see usage instructions:

$ crc32.py -h
usage: crc32.py [-h] action ...

Reverse, undo, and calculate CRC32 checksums

positional arguments:
  action
    poly (p)   print the polynomial, useful for converting between forms
    table (t)  generate a lookup table for a polynomial
    reverse (r)
               find a patch that causes the CRC32 checksum to become a desired value
    undo (u)   rewind a CRC32 checksum
    calc (c)   calculate the CRC32 checksum

options:
  -h, --help   show this help message and exit

References

crc32's People

Contributors

theonlypwner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

crc32's Issues

Matrix Tricks: combine CRC32, append repeated data

With a matrix and exponentiation by squaring, appending a block of data can be represented as an affine transformation, and the result of appending it N times to an existing hash can be computed in O(log N) time.

crc32_combine in zlib uses a linear transformation for appending zeroes to speed up combining CRC32 checksums. CRC(AB) = CRC(A0 ^ B0) = CRC(A0) ^ CRC(0B) = CRC(A0) ^ CRC(B) = M * CRC(A) ^ b. One zero byte needs to be appended to A for each zero byte in B, and then the checksums can be combined. This is an affine transformation with M as a matrix appending len(B) zero bytes (computed in O(log N) time as in crc32_combine) and b = CRC(B). Similarly, the affine transform that corresponds to applying that affine transform k times can be computed in O(log k) time. The total time complexity is O(log N + log k).

This would likely introduce a combine <c1> <c2> <len2> [n=1] command, which computes the effect of appending something with checksum c2 and length len2 to something with checksum c1 n times.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.