crc

package
v0.0.0-...-04928c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2015 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package crc implements the checksum algorithm used throughout leveldb.

The algorithm is CRC-32 with Castagnoli's polynomial, followed by a bit rotation and an additional delta. The additional processing is to lessen the probability of arbitrary key/value data coincidental contains bytes that look like a checksum.

To calculate the uint32 checksum of some data:

var u uint32 = crc.New(data).Value()

In leveldb, the uint32 value is then stored in little-endian format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRC

type CRC uint32

func New

func New(b []byte) CRC

func (CRC) Update

func (c CRC) Update(b []byte) CRC

func (CRC) Value

func (c CRC) Value() uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL