checksum

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMismatch = errors.New("checksum mismatch error")

ErrMismatch indicates a checksum verification failure due to a derived checksum not being equal to expected checksum

Functions

func GenerateCRC32

func GenerateCRC32(
	payload Marshaler,
	payloadVersion int32,
) (*persistencespb.Checksum, error)

GenerateCRC32 generates an IEEE crc32 checksum on the serilized byte array of the given thrift object. The serialization proto used will be of type thriftRW

func Verify

func Verify(
	payload Marshaler,
	checksum *persistencespb.Checksum,
) error

Verify verifies that the checksum generated from the given thrift object matches the specified expected checksum Return ErrMismatch when checksums mismatch

Types

type Marshaler added in v1.23.0

type Marshaler interface {
	Marshal() ([]byte, error)
}

Jump to

Keyboard shortcuts

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