Giter Site home page Giter Site logo

checksum-tapestry's Introduction

checksum-tapestry checksum crate

build

This is a crate containing a selection of checksum algorithms. It includes CRC, Fletcher16, and Adler32,

It includes tests for all algorithms. The tests come from various sources.

For the CRC code, the crc-catalog crate provides a catalog of common CRC parameters. The parameter model this crate uses is described in:

Williams, Ross N. "A Painless Guide to CRC Error Detection Algorithms", Rocksoft Pty Ltd., 1993, crc_ross.pdf, http://ross.net/crc/download/crc_v3.txt

The crc crate by Rui Hu and Akhil Velagapudi also provided code patterns that were helpful in building this library.

This document also provides a good description of what the parameters mean.

For the Adler32 code, the Go hash package provided test cases.

Several Wikipedia pages on Computation of cyclic redundancy checks and Adler and Fletcher checksums were also helpful.

Test cases include various values from common CRC polynomials. This includes the default crc32 used in zlib.

Usage

The crate provides documentation and examples showing how to use the different checksum algorithms. All the checksum implementations use a common trait called Checksum that provides two functions: compute and update. compute takes a u8 slice and computes a checksum over the entire slice. update allows rolling updates based on single u8 values.

Security and Safety

These algorithms are not safe against side-channel attacks.

These checksum implementations have not been audited by a third-party for use in safety critical applications. While they provide some test coverage, the test sources have not been checked themselves.

This crate can provide a good basis to build a test-driven checksum library, but it should not be considered authoritative.

Examples

This crate also provides some examples showing how to use the checksums and different parameters of each.

A visualization of the weaknesses of Adler-32 on short messages:

$ cargo run --example adler32_output_space_use

References

crc_v3.txt Ross Williams CRC Guide is the authoritative source for a lot of current CRC library APIs. It describes which parameters are included and the historical reasons they are needed.

komrad36 The README.md file in this repository provides an easy to understand overview of Cyclic Redundancy Checks. It provides smaller, easier to work through examples than some of the other tutorials and references online.

sarwate Dilip Sarwate was one of the first papers to describe methods for using table to pre-compute Cyclic Redundancy codes.

https://datatracker.ietf.org/doc/rfc3385/ Provides discussion of CRC selection in the context of error models. Outlines reasons to select CRC32C for iSCSI.

checksum-tapestry's People

Contributors

jgerrish avatar

Watchers

 avatar  avatar

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.