integrity

package
v1.30.21 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRC32Reader

type CRC32Reader struct {
	// contains filtered or unexported fields
}

func NewCRC32Reader

func NewCRC32Reader(r io.Reader) *CRC32Reader

func (*CRC32Reader) Hash

func (rc *CRC32Reader) Hash() []byte

func (*CRC32Reader) N

func (rc *CRC32Reader) N() int

func (*CRC32Reader) Read

func (rc *CRC32Reader) Read(p []byte) (n int, err error)

func (*CRC32Reader) Reset

func (rc *CRC32Reader) Reset()

type CRC32Resumable added in v1.29.8

type CRC32Resumable struct {
	// contains filtered or unexported fields
}

CRC32Resumable implements hash.Hash32 and supports reseeding. Always uses crc32.IEEE polynomial.

func NewCRC32Resumable added in v1.29.8

func NewCRC32Resumable(seed uint32) *CRC32Resumable

NewCRC32Resumable creates a new CRC32Resumable starting at a given CRC seed.

func (*CRC32Resumable) BlockSize added in v1.29.8

func (c *CRC32Resumable) BlockSize() int

BlockSize returns the block size of the hash (1).

func (*CRC32Resumable) Reseed added in v1.29.8

func (c *CRC32Resumable) Reseed(seed uint32)

Reseed manually sets a new CRC seed value.

func (*CRC32Resumable) Reset added in v1.29.8

func (c *CRC32Resumable) Reset()

Reset resets the CRC to zero.

func (*CRC32Resumable) Size added in v1.29.8

func (c *CRC32Resumable) Size() int

Size returns the number of bytes Sum will return (4).

func (*CRC32Resumable) Sum added in v1.29.8

func (c *CRC32Resumable) Sum(b []byte) []byte

Sum returns the checksum appended to b in big-endian order.

func (*CRC32Resumable) Sum32 added in v1.29.8

func (c *CRC32Resumable) Sum32() uint32

Sum32 returns the current CRC value.

func (*CRC32Resumable) Write added in v1.29.8

func (c *CRC32Resumable) Write(p []byte) (n int, err error)

Write updates the CRC with data.

type CRC32Writer

type CRC32Writer struct {
	// contains filtered or unexported fields
}

func NewCRC32Writer

func NewCRC32Writer(w io.Writer) *CRC32Writer

func NewCRC32WriterWithSeed added in v1.29.8

func NewCRC32WriterWithSeed(w io.Writer, seed uint32) *CRC32Writer

func (*CRC32Writer) Hash

func (wc *CRC32Writer) Hash() []byte

func (*CRC32Writer) HashWrite

func (wc *CRC32Writer) HashWrite(p []byte) (int, error)

func (*CRC32Writer) N

func (wc *CRC32Writer) N() int

func (*CRC32Writer) Reset

func (wc *CRC32Writer) Reset()

func (*CRC32Writer) Write

func (wc *CRC32Writer) Write(p []byte) (n int, err error)

type ChecksumReader

type ChecksumReader interface {
	io.Reader
	N() int
	Hash() []byte
	Reset()
}

type ChecksumWriter

type ChecksumWriter interface {
	io.Writer
	N() int
	Hash() []byte
	HashWrite([]byte) (int, error)
	Reset()
}

Jump to

Keyboard shortcuts

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