The cl-crc64 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-crc64 Reference Manual

This is the cl-crc64 Reference Manual, version 0.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:02:40 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

cl-crc64

cl-crc64 implements 64 bit cyclic redundancy checks in Common Lisp.

A cyclic redundancy check (CRC) is a type of hash function that produces a checksum (a small, fixed number of bits) against a block of data, such as a packet of network traffic or a block of a computer file. The checksum is used to detect errors after transmission or storage.

CRCs can also act as a kind of electronic fingerprint for identifying blocks of data. SWISS-PROT + TREMBL use a 64-bit Cyclic Redundancy Check for the amino acid sequences. My interest was in using CRC64 to index data in a semantic web triple store.

This implementation is influenced heavily by Python code by Gian Paolo Ciceri and crc.lisp by R. Matthew Emerson. My thanks to both these authors.

For a more thorough discussion of CRC see W. H. Press, S. A.Teukolsky, W. T. Vetterling, and B. P. Flannery, "Numerical recipes in C", 2nd ed., Cambridge University Press. Pages 896ff.

The code comes with BSD-style license so you can basically do whatever you want with it.

Example

cl-crc64 is ASDF installable, but assuming that you have QuickLisp installed:

 Rob-Blackwells-MacBook:cl-crc64 reb$ sbcl
 This is SBCL 1.0.29, an implementation of ANSI Common Lisp.
 More information about SBCL is available at <http://www.sbcl.org/>.
 
 SBCL is free software, provided as is, with absolutely no warranty.
 It is mostly in the public domain; some portions are provided under
 BSD-style licenses.  See the CREDITS and COPYING files in the
 distribution for more information.
 * (ql:quickload "cl-crc64")
 To load "cl-crc64":
   Load 1 ASDF system:
       cl-crc64
       ; Loading "cl-crc64"
       [package cl-crc64].
       ("cl-crc64")
   * (use-package :cl-crc64)

   T
   * (initialise-crc64 +polynomial+)
   
   NIL
   * (format nil "~X" (crc64-sequence "IHATEMATH"))

   "E3DCADD69B01ADD1"
   * 

WARNING: This is old code that I've pulled out, repackaged and open sourced. It was used as part of a demo some years back, but you probably want to test it thoroughly for new projects.

Rob Blackwell

October 2010


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-crc64

Author

Rob Blackwell <rob.blackwell@aws.net>

License

BSD

Description

Computes 64-bit cyclic redundancy checks

Version

0.1

Source

cl-crc64.asd (file)

Component

crc64.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-crc64.asd

Location

cl-crc64.asd

Systems

cl-crc64 (system)

Packages

cl-crc64-asd


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-crc64/crc64.lisp

Parent

cl-crc64 (system)

Location

crc64.lisp

Packages

cl-crc64

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-crc64-asd

Source

cl-crc64.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 cl-crc64

Source

crc64.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Constants

Constant: +improved-polynomial+
Package

cl-crc64

Source

crc64.lisp (file)

Constant: +polynomial+
Package

cl-crc64

Source

crc64.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: crc64-file ()

Calculates the CRC64 of the file specified by pathname.

Package

cl-crc64

Source

crc64.lisp (file)

Function: crc64-sequence ()

Calculates the CRC64 from sequence, which is either a simple-string or a simple-array with element-type (unsigned-byte 8)

Package

cl-crc64

Source

crc64.lisp (file)

Function: crc64-stream ()

Calculates the CRC64 on the given stream.

Package

cl-crc64

Source

crc64.lisp (file)

Function: initialise-crc64 POLYNOMIAL

Computes lookup tables of CRC values for byte values 0 thru 255

Package

cl-crc64

Source

crc64.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *crc-table-h*
Package

cl-crc64

Source

crc64.lisp (file)

Special Variable: *crc-table-l*
Package

cl-crc64

Source

crc64.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-crc64.asd: The cl-crc64<dot>asd file
cl-crc64/crc64.lisp: The cl-crc64/crc64<dot>lisp file

F
File, Lisp, cl-crc64.asd: The cl-crc64<dot>asd file
File, Lisp, cl-crc64/crc64.lisp: The cl-crc64/crc64<dot>lisp file

L
Lisp File, cl-crc64.asd: The cl-crc64<dot>asd file
Lisp File, cl-crc64/crc64.lisp: The cl-crc64/crc64<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   C   F   I  
Index Entry  Section

C
crc64-file: Exported functions
crc64-sequence: Exported functions
crc64-stream: Exported functions

F
Function, crc64-file: Exported functions
Function, crc64-sequence: Exported functions
Function, crc64-stream: Exported functions
Function, initialise-crc64: Exported functions

I
initialise-crc64: Exported functions

Jump to:   C   F   I  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   S  
Index Entry  Section

*
*crc-table-h*: Internal special variables
*crc-table-l*: Internal special variables

+
+improved-polynomial+: Exported constants
+polynomial+: Exported constants

C
Constant, +improved-polynomial+: Exported constants
Constant, +polynomial+: Exported constants

S
Special Variable, *crc-table-h*: Internal special variables
Special Variable, *crc-table-l*: Internal special variables

Jump to:   *   +  
C   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-crc64: The cl-crc64 system
cl-crc64: The cl-crc64 package
cl-crc64-asd: The cl-crc64-asd package

P
Package, cl-crc64: The cl-crc64 package
Package, cl-crc64-asd: The cl-crc64-asd package

S
System, cl-crc64: The cl-crc64 system

Jump to:   C   P   S