crc

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

crc16 verify model

crc32 verify model

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateCRC16

func CalculateCRC16(lens uint16, raw []byte) uint16
func init() {
	raw := []byte{0x01, 0x03, 0x04, 0x00, 0xd4, 0x02, 0x9e}
	fmt.Printf("*********crc16*********[%x]\n", CalculateCRC16Modbus(7, raw))
}

lens:input []byte length raw:input []byte

func CalculateCRC16Modbus

func CalculateCRC16Modbus(len uint16, raw []byte) uint16

func CalculateCRC32

func CalculateCRC32(lens uint32, raw []byte) uint32
func init() {
	raw := []byte{0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x52, 0x80, 0x01, 0x00, 0x00}
	fmt.Printf("**************crc32************[%x]\n", CalculateCRC32(10, raw))
}

lens:input []byte length raw:input []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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