cksum

package
v0.0.0-...-9e28d38 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cksum handles adding and checking checksums on data. crc32 since this is faster than adler32. Castagnoli because it slows down less for random data lengths. It only uses the low 16 bits of the crc32 to save space. From testing this doesn't impair error detection much.

Index

Constants

View Source
const Len = 2 // 16 bits

Variables

This section is empty.

Functions

func Check

func Check(data []byte) bool

Check computes the checksum of data (excluding the checksum space) and compares it to the stored value at the end of the data.

func MustCheck

func MustCheck(data []byte)

MustCheck panics on failure

func Update

func Update(data []byte)

Update computes the checksum of data (excluding the checksum space) and stores it in the last Len bytes of data. The caller must allocate the space for the checksum.

Types

This section is empty.

Jump to

Keyboard shortcuts

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