crc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: BSD-3-Clause Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sum

func Sum(bs []byte) []byte

Sum appends the hash of input to it and returns the resulting slice.

func Validate

func Validate(bs []byte) bool

Validate return true if byte slice ends with valid CRC.

Types

type Hash

type Hash interface {
	// Write (via the embedded io.Writer interface) adds more data to the running hash.
	// It never returns an error.
	io.Writer

	// Sum appends the current hash to b and returns the resulting slice.
	// It does not change the underlying hash state.
	Sum(b []byte) []byte

	// Reset resets the Hash to its initial state.
	Reset()
}

Hash is a subset of hash.Hash.

func New

func New() Hash

New returns a new Hash computing the Modbus CRC checksum.

Jump to

Keyboard shortcuts

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