Documentation
¶
Index ¶
- Variables
- func AppendCrc16(data []byte) []byte
- func AppendCrc32(data []byte) []byte
- func AppendCrc8(data []byte) []byte
- func Crc16(data []byte) uint16
- func Crc16Continue(data []byte, prev uint16) (uint16, error)
- func Crc16Impl(data []byte, table []uint16, init uint16, refin bool, refout bool, ...) uint16
- func Crc16Predefined(data []byte, configIndex int) (uint16, error)
- func Crc32(data []byte) uint32
- func Crc32Continue(data []byte, prev uint32) (uint32, error)
- func Crc32Impl(data []byte, table []uint32, init uint32, refin bool, refout bool, ...) uint32
- func Crc32Predefined(data []byte, configIndex int) (uint32, error)
- func Crc8(data []byte) byte
- func Crc8Continue(data []byte, prev byte) (byte, error)
- func Crc8Impl(data []byte, table []byte, init byte, refin bool, refout bool, xorout byte) byte
- func Crc8Predefined(data []byte, configIndex int) (byte, error)
- func MakeCrc16Table(poly uint16) []uint16
- func MakeCrc32Table(poly uint32) []uint32
- func MakeCrc8Table(poly byte) []byte
- func VerifyCrc16(data []byte) bool
- func VerifyCrc32(data []byte) bool
- func VerifyCrc8(data []byte) bool
- type Config
- type InvalidIndexError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Crc8Configs = []Config{ {0x07, 0x00, 0x00, false, false}, {0x9B, 0xFF, 0x00, false, false}, {0x39, 0x00, 0x00, true, true}, {0xD5, 0x00, 0x00, false, false}, {0x1D, 0xFF, 0x00, true, true}, {0x1D, 0xFD, 0x00, false, false}, {0x07, 0x00, 0x55, false, false}, {0x31, 0x00, 0x00, true, true}, {0x07, 0xFF, 0x00, true, true}, {0x9B, 0x00, 0x00, true, true}, } Crc16Configs = []Config{ {0x1021, 0xFFFF, 0x0000, false, false}, {0x8005, 0x0000, 0x0000, true, true}, {0x1021, 0x1D0F, 0x0000, false, false}, {0x8005, 0x0000, 0x0000, false, false}, {0xC867, 0xFFFF, 0x0000, false, false}, {0x8005, 0x800D, 0x0000, false, false}, {0x0589, 0x0000, 0x0001, false, false}, {0x0589, 0x0000, 0x0000, false, false}, {0x3D65, 0x0000, 0xFFFF, true, true}, {0x3D65, 0x0000, 0xFFFF, false, false}, {0x1021, 0xFFFF, 0xFFFF, false, false}, {0x8005, 0x0000, 0xFFFF, true, true}, {0x1021, 0xFFFF, 0x0000, true, true}, {0x8BB7, 0x0000, 0x0000, false, false}, {0xA097, 0x0000, 0x0000, false, false}, {0x8005, 0xFFFF, 0xFFFF, true, true}, {0x1021, 0x0000, 0x0000, true, true}, {0x8005, 0xFFFF, 0x0000, true, true}, {0x1021, 0xFFFF, 0xFFFF, true, true}, {0x1021, 0x0000, 0x0000, false, false}, } Crc32Configs = []Config{ {0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true}, {0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, false, false}, {0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true}, {0xA833982B, 0xFFFFFFFF, 0xFFFFFFFF, true, true}, {0x04C11DB7, 0xFFFFFFFF, 0x00000000, false, false}, {0x04C11DB7, 0x00000000, 0xFFFFFFFF, false, false}, {0x814141AB, 0x00000000, 0x00000000, false, false}, {0x04C11DB7, 0xFFFFFFFF, 0x00000000, true, true}, {0x000000AF, 0x00000000, 0x00000000, false, false}, } )
Reference: http://crccalc.com/ http://www.sunshine2k.de/coding/javascript/crc/crc_js.html http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html
View Source
var ( DefaultCrc8ConfigIndex = 0 DefaultCrc16ConfigIndex = 17 DefaultCrc32ConfigIndex = 0 )
Functions ¶
func AppendCrc16 ¶
func AppendCrc32 ¶
func AppendCrc8 ¶
func MakeCrc16Table ¶
func MakeCrc32Table ¶
func MakeCrc8Table ¶
func VerifyCrc16 ¶
func VerifyCrc32 ¶
func VerifyCrc8 ¶
Types ¶
type InvalidIndexError ¶
type InvalidIndexError int
func (InvalidIndexError) Error ¶
func (e InvalidIndexError) Error() string
Click to show internal directories.
Click to hide internal directories.