crc

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package crc is TreeDB's audited CRC-32 facade.

All functions use the CRC-32/IEEE polynomial and preserve the byte-for-byte values produced by hash/crc32.ChecksumIEEE and hash/crc32.Update. TreeDB stores these checksum bytes on disk, so this package centralizes routing through github.com/snissn/go-crc32-asm without changing the polynomial or verification semantics.

go-crc32-asm selects architecture-specific acceleration where available and uses its bit-compatible fallback on unsupported architectures; callers must treat either path as the same fail-closed verification primitive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(data []byte) uint32

Checksum returns the CRC-32/IEEE checksum of data.

func ChecksumParts

func ChecksumParts(parts ...[]byte) uint32

ChecksumParts returns the CRC-32/IEEE checksum over the concatenation of parts.

func Update added in v0.2.0

func Update(sum uint32, data []byte) uint32

Update extends sum with data using the CRC-32/IEEE polynomial.

Types

This section is empty.

Jump to

Keyboard shortcuts

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