common

package
v0.0.0-...-71e9170 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACK  = 0x00
	NACK = 0xFF
)

Acknoledgement

Variables

View Source
var ErrLength = errors.New("message too long")

ErrLength happens when message length is equal or over 256*256

View Source
var Sequence = []byte{0x2A, 0x00, 0x2A, 0x00}

Sequence used to start and end a message

Functions

func Checksum

func Checksum(b []byte) []byte

Checksum returns a custom checksum for the given data

func CreateMessage

func CreateMessage(content []byte) ([]byte, error)

CreateMessage encodes the message

func MessageContent

func MessageContent(b []byte) ([]byte, error)

MessageContent verifies a message and extracts its content

Types

This section is empty.

Jump to

Keyboard shortcuts

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