checksum

package
v0.0.0-...-6fd7d3d Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package checksum describes algorithms for finding various checksums

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRC8

func CRC8(data []byte, model CRCModel) uint8

CRC8 calculates CRC8 checksum of the given data.

func Luhn

func Luhn(s []byte) bool

Luhn validates the provided data using the Luhn algorithm.

Types

type CRCModel

type CRCModel struct {
	Poly   uint8
	Init   uint8
	RefIn  bool
	RefOut bool
	XorOut uint8
	Name   string
}

CRCModel contains the necessary parameters for calculating the DRC algorithm

Jump to

Keyboard shortcuts

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