crc64

package
v2.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 1 Imported by: 2

Documentation

Overview

Package crc64 implements the Avro CRC-64 checksum. See https://avro.apache.org/docs/current/spec.html#schema_fingerprints for information.

Index

Constants

View Source
const Empty = 0xc15d213aa4d7a795

Empty is the empty checksum.

View Source
const Size = 8

Size is the of a CRC-64 checksum in bytes.

Variables

This section is empty.

Functions

func New

func New() hash.Hash64

New creates a new hash.Hash64 computing the Avro CRC-64 checksum. Its Sum method will lay the value out in big-endian byte order.

func NewWithByteOrder added in v2.28.0

func NewWithByteOrder(byteOrder ByteOrder) hash.Hash64

NewWithByteOrder creates a new hash.Hash64 computing the Avro CRC-64 checksum. Its Sum method will lay the value out in specified byte order.

func Sum added in v2.22.0

func Sum(data []byte) [Size]byte

Sum returns the CRC64 checksum of the data, in big-endian byte order.

func SumWithByteOrder added in v2.28.0

func SumWithByteOrder(data []byte, byteOrder ByteOrder) [Size]byte

SumWithByteOrder returns the CRC64 checksum of the data, in specified byte order.

Types

type ByteOrder added in v2.28.0

type ByteOrder int

ByteOrder denotes how integers are encoded into bytes. The ByteOrder interface in encoding/binary cancels some optimizations, so use a more direct implementation.

const (
	LittleEndian ByteOrder = iota
	BigEndian
)

ByteOrder constants.

type Table

type Table [256]uint64

Table is a 256-word table representing the polynomial for efficient processing.

Jump to

Keyboard shortcuts

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